|
Data Structures |
struct | pbm_set |
union | _dbswap |
struct | miRE_s |
struct | _rpmdbMatchIterator |
struct | skipDir_s |
Defines |
#define | _USE_COPY_LOAD |
#define | _DBI_FLAGS 0 |
#define | _DBI_PERMS 0644 |
#define | _DBI_MAJOR -1 |
#define | __PBM_NBITS (8 * sizeof (__pbm_bits)) |
#define | __PBM_IX(d) ((d) / __PBM_NBITS) |
#define | __PBM_MASK(d) ((__pbm_bits) 1 << (((unsigned)(d)) % __PBM_NBITS)) |
#define | __PBM_BITS(set) ((set)->bits) |
#define | PBM_FREE(s) _free(s); |
#define | PBM_SET(d, s) (__PBM_BITS (s)[__PBM_IX (d)] |= __PBM_MASK (d)) |
#define | PBM_CLR(d, s) (__PBM_BITS (s)[__PBM_IX (d)] &= ~__PBM_MASK (d)) |
#define | PBM_ISSET(d, s) ((__PBM_BITS (s)[__PBM_IX (d)] & __PBM_MASK (d)) != 0) |
#define | PBM_ALLOC(d) xcalloc(__PBM_IX (d) + 1, sizeof(__pbm_bits)) |
#define | DB1vec NULL |
#define | DB2vec NULL |
#define | DB3vec NULL |
#define | SQLITEvec NULL |
#define | SQLITE_HACK |
#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_ERRPFX "rpmdb" |
#define | _skip(_dn) { sizeof(_dn)-1, (_dn) } |
#define | _RECNUM rpmdbGetIteratorOffset(mi) |
Typedefs |
typedef unsigned int | __pbm_bits |
typedef struct miRE_s * | miRE |
Functions |
static pbm_set * | PBM_REALLOC (pbm_set **sp, int *odp, int nd) |
| Reallocate a bit map.
|
static unsigned char | nibble (char c) |
| Convert hex to binary nibble.
|
static int | dbiTagToDbix (int rpmtag) |
| Return dbi index used for rpm tag.
|
static void | dbiTagsInit (void) |
| Initialize database (index, tag) tuple from configuration.
|
dbiIndex | dbiOpen (rpmdb db, rpmTag rpmtag, unsigned int flags) |
| Return handle for an index database.
|
static dbiIndexItem | dbiIndexNewItem (unsigned int hdrNum, unsigned int tagNum) |
| Create and initialize item for index database set.
|
static int | dbt2set (dbiIndex dbi, DBT *data, dbiIndexSet *setp) |
| Convert retrieved data to index set.
|
static int | set2dbt (dbiIndex dbi, DBT *data, dbiIndexSet set) |
| Convert index set to database representation.
|
static int | hdrNumCmp (const void *one, const void *two) |
static int | dbiAppendSet (dbiIndexSet set, const void *recs, int nrecs, size_t recsize, int sortset) |
| Append element(s) to set of index database items.
|
static int | dbiPruneSet (dbiIndexSet set, void *recs, int nrecs, size_t recsize, int sorted) |
| Remove element(s) from set of index database items.
|
unsigned int | dbiIndexSetCount (dbiIndexSet set) |
| Count items in index database set.
|
unsigned int | dbiIndexRecordOffset (dbiIndexSet set, int recno) |
| Return record offset of header from element in index database set.
|
unsigned int | dbiIndexRecordFileNumber (dbiIndexSet set, int recno) |
| Return file index from element in index database set.
|
dbiIndexSet | dbiFreeIndexSet (dbiIndexSet set) |
| Destroy set of index database items.
|
int | rpmdbCheckTerminate (int terminate) |
| Check rpmdb signal handler for trapped signal and/or requested exit, clean up any open iterators and databases on termination condition.
|
int | rpmdbCheckSignals (void) |
| Check for and exit on termination signals.
|
static int | blockSignals (rpmdb db, sigset_t *oldMask) |
| Block all signals, returning previous signal mask.
|
static int | unblockSignals (rpmdb db, sigset_t *oldMask) |
| Restore signal mask.
|
static int | isTemporaryDB (int rpmtag) |
int | rpmdbOpenAll (rpmdb db) |
| Open all database indices.
|
int | rpmdbCloseDBI (rpmdb db, int rpmtag) |
| Close a single database index.
|
int | rpmdbClose (rpmdb db) |
| Close all database indices and free rpmdb.
|
int | rpmdbSync (rpmdb db) |
| Sync all database indices.
|
static rpmdb | newRpmdb (const char *root, const char *home, int mode, int perms, int flags) |
static int | openDatabase (const char *prefix, const char *dbpath, int _dbapi, rpmdb *dbp, int mode, int perms, int flags) |
rpmdb | XrpmdbUnlink (rpmdb db, const char *msg, const char *fn, unsigned ln) |
rpmdb | XrpmdbLink (rpmdb db, const char *msg, const char *fn, unsigned ln) |
int | rpmdbOpen (const char *prefix, rpmdb *dbp, int mode, int perms) |
| Open rpm database.
|
int | rpmdbInit (const char *prefix, int perms) |
| Initialize database.
|
int | rpmdbVerify (const char *prefix) |
| Verify database components.
|
static int | rpmdbFindByFile (rpmdb db, const char *filespec, DBT *key, DBT *data, dbiIndexSet *matches) |
| Find file matches in database.
|
int | rpmdbCountPackages (rpmdb db, const char *name) |
| Return number of instances of package in rpm database.
|
static rpmRC | dbiFindMatches (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, const char *name, const char *version, const char *release, dbiIndexSet *matches) |
| Attempt partial matches on name[-version[-release]] strings.
|
static rpmRC | dbiFindByLabel (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, const char *arg, dbiIndexSet *matches) |
| Lookup by name, name-version, and finally by name-version-release.
|
static int | miFreeHeader (rpmdbMatchIterator mi, dbiIndex dbi) |
| Rewrite a header into packages (if necessary) and free the header.
|
rpmdbMatchIterator | rpmdbFreeIterator (rpmdbMatchIterator mi) |
| Destroy rpm database iterator.
|
unsigned int | rpmdbGetIteratorOffset (rpmdbMatchIterator mi) |
| Return header join key for current position of rpm database iterator.
|
unsigned int | rpmdbGetIteratorFileNum (rpmdbMatchIterator mi) |
int | rpmdbGetIteratorCount (rpmdbMatchIterator mi) |
| Return number of elements in rpm database iterator.
|
static int | miregexec (miRE mire, const char *val) |
| Return pattern match.
|
static int | mireCmp (const void *a, const void *b) |
| Compare iterator selectors by rpm tag (qsort/bsearch).
|
static char * | mireDup (rpmTag tag, rpmMireMode *modep, const char *pattern) |
| Copy pattern, escaping for appropriate mode.
|
int | rpmdbSetIteratorRE (rpmdbMatchIterator mi, rpmTag tag, rpmMireMode mode, const char *pattern) |
| Add pattern to iterator selector.
|
static int | mireSkip (const rpmdbMatchIterator mi) |
| Return iterator selector match.
|
int | rpmdbSetIteratorRewrite (rpmdbMatchIterator mi, int rewrite) |
| Prepare iterator for lazy writes.
|
int | rpmdbSetIteratorModified (rpmdbMatchIterator mi, int modified) |
| Modify iterator to mark header for lazy write on release.
|
int | rpmdbSetHdrChk (rpmdbMatchIterator mi, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg)) |
| Modify iterator to verify retrieved header blobs.
|
Header | rpmdbNextIterator (rpmdbMatchIterator mi) |
| Return next package header from iteration.
|
static void | rpmdbSortIterator (rpmdbMatchIterator mi) |
static int | rpmdbGrowIterator (rpmdbMatchIterator mi, int fpNum) |
int | rpmdbPruneIterator (rpmdbMatchIterator mi, int *hdrNums, int nHdrNums, int sorted) |
| Remove items from set of package instances to iterate.
|
int | rpmdbAppendIterator (rpmdbMatchIterator mi, const int *hdrNums, int nHdrNums) |
| Append items to set of package instances to iterate.
|
rpmdbMatchIterator | rpmdbInitIterator (rpmdb db, rpmTag rpmtag, const void *keyp, size_t keylen) |
| Return database iterator.
|
int | rpmdbRemove (rpmdb db, int rid, unsigned int hdrNum, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg)) |
| Remove package header from rpm database and indices.
|
int | rpmdbAdd (rpmdb db, int iid, Header h, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg)) |
| Add package header to rpm database and indices.
|
static int | skipDir (const char *dn) |
int | rpmdbFindFpList (rpmdb db, fingerPrint *fpList, dbiIndexSet *matchList, int numItems) |
| Find fingerprint matches in database.
|
static int | rpmioFileExists (const char *urlfn) |
| Check if file esists using stat(2).
|
static int | rpmdbRemoveDatabase (const char *prefix, const char *dbpath, int _dbapi) |
static int | rpmdbMoveDatabase (const char *prefix, const char *olddbpath, int _olddbapi, const char *newdbpath, int _newdbapi) |
int | rpmdbRebuild (const char *prefix, rpmts ts, rpmRC(*hdrchk)(rpmts ts, const void *uh, size_t uc, const char **msg)) |
| Rebuild database indices from package headers.
|
Variables |
int | _rpmdb_debug = 0 |
static int | _rebuildinprogress = 0 |
static int | _db_filter_dups = 0 |
int * | dbiTags = NULL |
| Tags for which rpmdb indices will be built.
|
int | dbiTagsMax = 0 |
unsigned int | myinstall_instance = 0 |
static struct _dbiVec * | mydbvecs [] |
static rpmdb | rpmdbRock |
static rpmdbMatchIterator | rpmmiRock |
static struct rpmdb_s | dbTemplate |
static struct skipDir_s | skipDirs [] |