#include "system.h"
#include <sys/file.h>
#include <signal.h>
#include <sys/signal.h>
#include <rpmlib.h>
#include <rpmmacro.h>
#include "rpmdb.h"
#include "fprint.h"
#include "misc.h"
#include "debug.h"
Go to the source code of this file.
Compounds | |
union | _dbswap |
struct | _rpmdbMatchIterator |
RPMDB | |
int | rpmdbOpenAll (rpmdb rpmdb) |
int | rpmdbClose (rpmdb rpmdb) |
int | rpmdbSync (rpmdb rpmdb) |
int | rpmdbOpen (const char *prefix, rpmdb *dbp, int mode, int perms) |
int | rpmdbInit (const char *prefix, int perms) |
int | rpmdbCountPackages (rpmdb rpmdb, const char *name) |
void | rpmdbFreeIterator (rpmdbMatchIterator mi) |
rpmdb | rpmdbGetIteratorRpmDB (rpmdbMatchIterator mi) |
unsigned int | rpmdbGetIteratorOffset (rpmdbMatchIterator mi) |
int | rpmdbGetIteratorCount (rpmdbMatchIterator mi) |
void | rpmdbSetIteratorRelease (rpmdbMatchIterator mi, const char *release) |
void | rpmdbSetIteratorVersion (rpmdbMatchIterator mi, const char *version) |
int | rpmdbSetIteratorModified (rpmdbMatchIterator mi, int modified) |
Header | XrpmdbNextIterator (rpmdbMatchIterator mi, const char *f, unsigned l) |
int | rpmdbPruneIterator (rpmdbMatchIterator mi, int *hdrNums, int nHdrNums, int sorted) |
int | rpmdbAppendIterator (rpmdbMatchIterator mi, int *hdrNums, int nHdrNums) |
rpmdbMatchIterator | rpmdbInitIterator (rpmdb rpmdb, int rpmtag, const void *keyp, size_t keylen) |
int | rpmdbRemove (rpmdb rpmdb, int rid, unsigned int hdrNum) |
int | rpmdbAdd (rpmdb rpmdb, int iid, Header h) |
int | rpmdbRebuild (const char *rootdir) |
Defines | |
#define | INLINE |
#define | _DBI_FLAGS 0 |
#define | _DBI_PERMS 0644 |
#define | _DBI_MAJOR -1 |
#define | DB1vec NULL |
#define | DB2vec NULL |
#define | DB3vec NULL |
#define | _DBSWAP(_a) |
#define | _DB_ROOT "/" |
#define | _DB_HOME "%{_dbpath}" |
#define | _DB_FLAGS 0 |
#define | _DB_MODE 0 |
#define | _DB_PERMS 0644 |
#define | _DB_MAJOR -1 |
#define | _DB_REMOVE_ENV 0 |
#define | _DB_FILTER_DUPS 0 |
#define | _DB_ERRPFX "rpmdb" |
#define | _RECNUM rpmdbGetIteratorOffset(mi) |
Functions | |
int | dbiTagToDbix (int rpmtag) |
Return dbi index used for rpm tag. More... | |
void | dbiTagsInit (void) |
Initialize database (index, tag) tuple from configuration. | |
int | dbiSync (dbiIndex dbi, unsigned int flags) |
int | dbiByteSwapped (dbiIndex dbi) |
int | XdbiCopen (dbiIndex dbi, DBC **dbcp, unsigned int flags, const char *f, unsigned int l) |
int | XdbiCclose (dbiIndex dbi, DBC *dbcursor, unsigned int flags, const char *f, unsigned int l) |
int | dbiDel (dbiIndex dbi, DBC *dbcursor, const void *keyp, size_t keylen, unsigned int flags) |
int | dbiGet (dbiIndex dbi, DBC *dbcursor, void **keypp, size_t *keylenp, void **datapp, size_t *datalenp, unsigned int flags) |
int | dbiPut (dbiIndex dbi, DBC *dbcursor, const void *keyp, size_t keylen, const void *datap, size_t datalen, unsigned int flags) |
int | dbiClose (dbiIndex dbi, unsigned int flags) |
dbiIndex | dbiOpen (rpmdb rpmdb, int rpmtag, unsigned int flags) |
dbiIndexItem | dbiIndexNewItem (unsigned int hdrNum, unsigned int tagNum) |
Create and initialize item for index database set. More... | |
int | dbiSearch (dbiIndex dbi, DBC *dbcursor, const char *keyp, size_t keylen, dbiIndexSet *setp) |
Return items that match criteria. More... | |
int | dbiUpdateIndex (dbiIndex dbi, DBC *dbcursor, const char *keyp, dbiIndexSet set) |
Change/delete items that match criteria. More... | |
int | hdrNumCmp (const void *one, const void *two) |
int | dbiAppendSet (dbiIndexSet set, const void *recs, int nrecs, size_t recsize, int sortset) |
Append element(s) to set of index database items. More... | |
int | dbiPruneSet (dbiIndexSet set, void *recs, int nrecs, size_t recsize, int sorted) |
Remove element(s) from set of index database items. More... | |
unsigned int | dbiIndexSetCount (dbiIndexSet set) |
unsigned int | dbiIndexRecordOffset (dbiIndexSet set, int recno) |
unsigned int | dbiIndexRecordFileNumber (dbiIndexSet set, int recno) |
void | dbiFreeIndexSet (dbiIndexSet set) |
void | blockSignals (rpmdb rpmdb, sigset_t *oldMask) |
Disable all signals, returning previous signal mask. | |
void | unblockSignals (rpmdb rpmdb, sigset_t *oldMask) |
Restore signal mask. | |
rpmdb | newRpmdb (const char *root, const char *home, int mode, int perms, int flags) |
int | openDatabase (const char *prefix, const char *dbpath, int _dbapi, rpmdb *dbp, int mode, int perms, int flags) |
int | rpmdbFindByFile (rpmdb rpmdb, const char *filespec, dbiIndexSet *matches) |
int | dbiFindMatches (dbiIndex dbi, DBC *dbcursor, const char *name, const char *version, const char *release, dbiIndexSet *matches) |
int | dbiFindByLabel (dbiIndex dbi, DBC *dbcursor, const char *arg, dbiIndexSet *matches) |
int | dbiUpdateRecord (dbiIndex dbi, DBC *dbcursor, int offset, Header h) |
Rewrite a header in the database. More... | |
unsigned int | rpmdbGetIteratorFileNum (rpmdbMatchIterator mi) |
void | rpmdbSortIterator (rpmdbMatchIterator mi) |
int | rpmdbGrowIterator (rpmdbMatchIterator mi, const void *keyp, size_t keylen, int fpNum) |
int | removeIndexEntry (dbiIndex dbi, DBC *dbcursor, const char *keyp, dbiIndexItem rec) |
int | addIndexEntry (dbiIndex dbi, DBC *dbcursor, const char *index, dbiIndexItem rec) |
int | rpmdbFindFpList (rpmdb rpmdb, fingerPrint *fpList, dbiIndexSet *matchList, int numItems) |
char* | db1basename (int rpmtag) |
int | rpmdbRemoveDatabase (const char *rootdir, const char *dbpath, int _dbapi) |
int | rpmdbMoveDatabase (const char *rootdir, const char *olddbpath, int _olddbapi, const char *newdbpath, int _newdbapi) |
Variables | |
int | _debug = 0 |
int | _noDirTokens |
int | _rebuildinprogress = 0 |
int | _db_filter_dups = 0 |
int | _filterDbDups = 0 |
int | dbiTagsMax = 0 |
int* | dbiTags = NULL |
struct _dbiVec* | mydbvecs [] |
struct rpmdb_s | dbTemplate |
Definition in file rpmdb.c.
|
|
|
|
|
|
|
Value: |
|
|
|
|
|
|
|
Value: { unsigned char _b, *_c = (_a).uc; \ _b = _c[3]; _c[3] = _c[0]; _c[0] = _b; \ _b = _c[2]; _c[2] = _c[1]; _c[1] = _b; \ } Definition at line 348 of file rpmdb.c. Referenced by dbiSearch(), and dbiUpdateIndex(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 1738 of file rpmdb.c. Referenced by rpmdbAdd(). |
|
Disable all signals, returning previous signal mask.
Definition at line 618 of file rpmdb.c. Referenced by dbiUpdateRecord(), rpmdbAdd(), and rpmdbRemove(). |
|
Append element(s) to set of index database items.
Definition at line 530 of file rpmdb.c. Referenced by addIndexEntry(), rpmdbAppendIterator(), rpmdbFindByFile(), and rpmdbFindFpList(). |
|
|
|
Definition at line 1119 of file rpmdb.c. Referenced by rpmdbInitIterator(). |
|
Definition at line 1037 of file rpmdb.c. Referenced by dbiFindByLabel(). |
|
|
|
Create and initialize item for index database set.
Definition at line 336 of file rpmdb.c. Referenced by rpmdbAdd(), rpmdbFindByFile(), and rpmdbRemove(). |
|
Remove element(s) from set of index database items.
Definition at line 567 of file rpmdb.c. Referenced by removeIndexEntry(), and rpmdbPruneIterator(). |
|
|
|
Return items that match criteria.
Definition at line 362 of file rpmdb.c. Referenced by addIndexEntry(), dbiFindMatches(), removeIndexEntry(), rpmdbCountPackages(), rpmdbFindByFile(), rpmdbGrowIterator(), and rpmdbInitIterator(). |
|
Return dbi index used for rpm tag.
Definition at line 45 of file rpmdb.c. Referenced by dbiOpen(), and dbiTagsInit(). |
|
Initialize database (index, tag) tuple from configuration.
Definition at line 61 of file rpmdb.c. Referenced by openDatabase(). |
|
Change/delete items that match criteria.
Definition at line 441 of file rpmdb.c. Referenced by addIndexEntry(), and removeIndexEntry(). |
|
Rewrite a header in the database. Note: this is called from a markReplacedFiles iteration, and *must* preserve the "join key" (i.e. offset) for the header.
Definition at line 1167 of file rpmdb.c. Referenced by XrpmdbNextIterator(), rpmdbAdd(), and rpmdbFreeIterator(). |
|
|
|
Definition at line 712 of file rpmdb.c. Referenced by openDatabase(). |
|
Definition at line 758 of file rpmdb.c. Referenced by rpmdbInit(), rpmdbOpen(), and rpmdbRebuild(). |
|
Definition at line 1582 of file rpmdb.c. Referenced by rpmdbRemove(). |
|
Definition at line 885 of file rpmdb.c. Referenced by rpmdbInitIterator(). |
|
Definition at line 1424 of file rpmdb.c. Referenced by rpmdbFindFpList(). |
|
Definition at line 2144 of file rpmdb.c. Referenced by rpmdbRebuild(). |
|
Definition at line 2092 of file rpmdb.c. Referenced by rpmdbMoveDatabase(), and rpmdbRebuild(). |
|
Definition at line 1416 of file rpmdb.c. Referenced by rpmdbFindFpList(). |
|
Restore signal mask.
Definition at line 632 of file rpmdb.c. Referenced by dbiUpdateRecord(), rpmdbAdd(), and rpmdbRemove(). |
|
|
|
|
|
|
|
|
|
|
|
Initial value: { "/" , "%{_dbpath}" , 0 , 0 , 0644 , -1 , 0 , 0 , "rpmdb" } |
|
|
|
|
|
Initial value: { NULL , NULL , NULL , NULL , NULL } |