rpm
5.4.15
|
#include "system.h"
#include <rpmlog.h>
#include <rpmmacro.h>
#include <rpmbf.h>
#include <rpmpgp.h>
#include <rpmurl.h>
#include <rpmtag.h>
#include <rpmevr.h>
#include <rpmdb.h>
#include "debug.h"
Go to the source code of this file.
Data Structures | |
union | _dbswap |
struct | key_s |
struct | _events_s |
Macros | |
#define | _RPMTAG_INTERNAL |
#define | _RPMEVR_INTERNAL /* XXX isInstallPrereq */ |
#define | _RPMDB_INTERNAL |
#define | DBIDEBUG(_dbi, _list) if ((_dbi)->dbi_debug) fprintf _list |
#define | _ENTRY(_v) { DB_##_v, #_v, } |
#define | _EFLAGS(_eflags) fmtDBeflags(_eflags) |
#define | _OFLAGS(_oflags) fmtDBoflags(_oflags) |
#define | _AFLAGS(_aflags) fmtDBaflags(_aflags) |
#define | _AFFLAGS(_afflags) fmtDBafflags(_afflags) |
#define | _DBCOFLAGS(_coflags) fmtDBCoflags(_coflags) |
#define | _DBCFLAGS(_flags) fmtDBCflags(_flags) |
#define | _DBT_ENTRY(_v) { DB_DBT_##_v, #_v, } |
#define | _KEYDATA(_K, _P, _D, _R) fmtKDR(_K, _P, _D, _R) |
#define | cvtdberr(_dbi, _msg, _error, _printit) Xcvtdberr(_dbi, _msg, _error, _printit, __FUNCTION__, __FILE__, __LINE__) |
#define | _TABLE(_v) { #_v, DB_EVENT_##_v } |
#define | _RPMDB_NLOCKS 16384 |
Typedefs | |
typedef struct key_s | KEY |
Functions | |
static uint64_t | _ntoh_ul (uint64_t ul) |
static uint64_t | _hton_ul (uint64_t ul) |
static uint32_t | _ntoh_ui (uint32_t ui) |
static uint32_t | _hton_ui (uint32_t ui) |
static uint16_t | _ntoh_us (uint16_t us) |
static uint16_t | _hton_us (uint16_t us) |
static const char * | tblName (uint32_t v, KEY *tbl, size_t ntbl) |
static const char * | fmtBits (uint32_t flags, KEY tbl[], size_t ntbl, char *t) |
static const char * | fmtDBeflags (uint32_t flags) |
static const char * | fmtDBoflags (uint32_t flags) |
static const char * | fmtDBaflags (uint32_t flags) |
static const char * | fmtDBafflags (uint32_t flags) |
static const char * | fmtDBCoflags (uint32_t flags) |
static const char * | fmtDBCflags (uint32_t flags) |
static char * | fmtDBT (const DBT *K, char *te) |
static const char * | fmtKDR (const DBT *K, const DBT *P, const DBT *D, const DBT *R) |
static int | Xcvtdberr (dbiIndex dbi, const char *msg, int error, int printit, const char *func, const char *fn, unsigned ln) |
static const char * | mapTagName (rpmdb rpmdb, dbiIndex dbi) |
Return (possibly renamed) tagName. More... | |
static int | db_fini (dbiIndex dbi, const char *dbhome, const char *dbfile, const char *dbsubfile) |
static int | db3_fsync_disable (int fd) |
static uint64_t | physmem (void) |
static size_t | ncores (void) |
static void | rpmdbe_event_notify (DB_ENV *dbenv, u_int32_t event, void *event_info) |
static void | rpmdbe_feedback (DB_ENV *dbenv, int opcode, int percent) |
static int | db_init (dbiIndex dbi, const char *dbhome, const char *dbfile, const char *dbsubfile, DB_ENV **dbenvp) |
static int | db3sync (dbiIndex dbi, unsigned int flags) |
static int | db3exists (dbiIndex dbi, DBT *key, unsigned int flags) |
static int | db3seqno (dbiIndex dbi, int64_t *seqnop, unsigned int flags) |
static int | db3cdup (dbiIndex dbi, DBC *dbcursor, DBC **dbcp, unsigned int flags) |
static int | db3cclose (dbiIndex dbi, DBC *dbcursor, unsigned int flags) |
static int | db3copen (dbiIndex dbi, DB_TXN *txnid, DBC **dbcp, unsigned int dbiflags) |
static int | db3cput (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, unsigned int flags) |
static int | db3cget (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, unsigned int flags) |
static int | db3cpget (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *pkey, DBT *data, unsigned int flags) |
static int | db3cdel (dbiIndex dbi, DBC *dbcursor, DBT *key, DBT *data, unsigned int flags) |
static int | db3ccount (dbiIndex dbi, DBC *dbcursor, unsigned int *countp, unsigned int flags) |
static int | db3byteswapped (dbiIndex dbi) |
static int | db3stat (dbiIndex dbi, unsigned int flags) |
static int | db3associate (dbiIndex dbi, dbiIndex dbisecondary, int(*callback)(DB *, const DBT *, const DBT *, DBT *), unsigned int flags) |
static int | db3associate_foreign (dbiIndex dbi, dbiIndex dbisecondary, int(*callback)(DB *, const DBT *, DBT *, const DBT *, int *), unsigned int flags) |
static int | db3join (dbiIndex dbi, DBC **curslist, DBC **dbcp, unsigned int flags) |
static int | db3close (dbiIndex dbi, unsigned int flags) |
static unsigned char | nibble (char c) |
Convert hex to binary nibble. More... | |
static int | loadDBT (DBT *_r, rpmTag tag, const void *_s, size_t ns) |
static int | uint32Cmp (const void *_a, const void *_b) |
static int | uint64Cmp (const void *_a, const void *_b) |
static int | db3Acallback (DB *db, const DBT *key, const DBT *data, DBT *_r) |
static int | seqid_init (dbiIndex dbi, const char *keyp, size_t keylen, DB_SEQUENCE **seqp) |
static int | db3open (rpmdb rpmdb, rpmTag rpmtag, dbiIndex *dbip) |
Return handle for an index database. More... | |
Variables | |
static int | _debug = 1 |
static union _dbswap | _endian = { .ui = 0x11223344 } |
static KEY | DBeflags [] |
static size_t | nDBeflags = sizeof(DBeflags) / sizeof(DBeflags[0]) |
static KEY | DBoflags [] |
static size_t | nDBoflags = sizeof(DBoflags) / sizeof(DBoflags[0]) |
static KEY | DBaflags [] |
static size_t | nDBaflags = sizeof(DBaflags) / sizeof(DBaflags[0]) |
static KEY | DBafflags [] |
static size_t | nDBafflags = sizeof(DBafflags) / sizeof(DBafflags[0]) |
static KEY | DBCoflags [] |
static size_t | nDBCoflags = sizeof(DBCoflags) / sizeof(DBCoflags[0]) |
static KEY | DBCflags [] |
static size_t | nDBCflags = sizeof(DBCflags) / sizeof(DBCflags[0]) |
static KEY | DBTflags [] |
static size_t | nDBTflags = sizeof(DBTflags) / sizeof(DBTflags[0]) |
static struct _events_s | _events [] |
struct _dbiVec | db3vec |
#define _AFFLAGS | ( | _afflags | ) | fmtDBafflags(_afflags) |
Definition at line 340 of file db3.c.
Referenced by db3associate_foreign().
#define _AFLAGS | ( | _aflags | ) | fmtDBaflags(_aflags) |
Definition at line 320 of file db3.c.
Referenced by db3associate().
#define _DBCFLAGS | ( | _flags | ) | fmtDBCflags(_flags) |
#define _DBCOFLAGS | ( | _coflags | ) | fmtDBCoflags(_coflags) |
Definition at line 364 of file db3.c.
Referenced by db3copen().
#define _EFLAGS | ( | _eflags | ) | fmtDBeflags(_eflags) |
#define _KEYDATA | ( | _K, | |
_P, | |||
_D, | |||
_R | |||
) | fmtKDR(_K, _P, _D, _R) |
Definition at line 552 of file db3.c.
Referenced by db3Acallback(), db3cdel(), db3cget(), db3cpget(), db3cput(), and db3exists().
#define _OFLAGS | ( | _oflags | ) | fmtDBoflags(_oflags) |
#define _RPMDB_NLOCKS 16384 |
Referenced by db_init().
#define cvtdberr | ( | _dbi, | |
_msg, | |||
_error, | |||
_printit | |||
) | Xcvtdberr(_dbi, _msg, _error, _printit, __FUNCTION__, __FILE__, __LINE__) |
Definition at line 573 of file db3.c.
Referenced by db3associate(), db3associate_foreign(), db3cclose(), db3ccount(), db3cdel(), db3cdup(), db3cget(), db3close(), db3copen(), db3cpget(), db3cput(), db3exists(), db3join(), db3open(), db3seqno(), db3stat(), db3sync(), db_fini(), and db_init().
#define DBIDEBUG | ( | _dbi, | |
_list | |||
) | if ((_dbi)->dbi_debug) fprintf _list |
Definition at line 37 of file db3.c.
Referenced by db3Acallback(), db3cclose(), db3ccount(), db3cdel(), db3cdup(), db3cget(), db3close(), db3copen(), db3cpget(), db3cput(), db3exists(), db3join(), db3open(), db3seqno(), db3stat(), db3sync(), db_fini(), and db_init().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Definition at line 103 of file db3.c.
References _ntoh_us().
|
inlinestatic |
Definition at line 74 of file db3.c.
References _dbswap::uc, and _dbswap::ui.
Referenced by _hton_ui(), and db3Acallback().
|
inlinestatic |
Definition at line 54 of file db3.c.
References _dbswap::uc, and _dbswap::ul.
Referenced by _hton_ul().
|
inlinestatic |
Definition at line 92 of file db3.c.
References _dbswap::uc, and _dbswap::us.
Referenced by _hton_us().
|
static |
Definition at line 1912 of file db3.c.
References _, _free(), _hton_ui(), _hton_ul(), _KEYDATA, _ntoh_ui(), alloca(), __db::app_private, rpmDataType_u::argv, _HE_s::c, __db_dbt::data, DB_DBT_APPMALLOC, DB_DBT_MULTIPLE, DBIDEBUG, __db_dbt::flags, headerFree(), headerGet(), headerLink(), headerLoad(), i, loadDBT(), ns, _HE_s::p, rpmDataType_u::ptr, RPM_BIN_TYPE, RPM_I18NSTRING_TYPE, RPM_STRING_ARRAY_TYPE, RPM_STRING_TYPE, RPM_UINT16_TYPE, RPM_UINT32_TYPE, RPM_UINT64_TYPE, RPM_UINT8_TYPE, rpmbfAdd(), rpmbfChk(), rpmbfFree(), rpmbfNew(), rpmbfParams(), rpmlog(), RPMLOG_ERR, RPMTAG_BASENAMES, RPMTAG_FILEMODES, RPMTAG_FILEPATHS, RPMTAG_INSTALLTID, RPMTAG_REMOVETID, RPMTAG_REQUIREFLAGS, RPMTAG_REQUIRENAME, RPMTAG_REQUIREYAMLENTRY, __db_dbt::size, rpmDataType_u::str, _HE_s::t, _HE_s::tag, tagName(), rpmDataType_u::ui16p, rpmDataType_u::ui32p, rpmDataType_u::ui64p, rpmDataType_u::ui8p, uint32Cmp(), uint64Cmp(), xcalloc(), and xmalloc.
Referenced by db3open().
|
static |
Definition at line 1473 of file db3.c.
References _DBCFLAGS, _debug, _KEYDATA, cvtdberr, DB_BUFFER_SMALL, DB_NOTFOUND, and DBIDEBUG.
Referenced by db3cdel().
|
static |
Definition at line 1737 of file db3.c.
References _debug, _free(), cvtdberr, D_, db_fini(), DBIDEBUG, mapTagName(), rpmGenPath(), rpmlog(), RPMLOG_DEBUG, and urlPath().
Referenced by db3open().
Definition at line 1412 of file db3.c.
References _DBCOFLAGS, _debug, cvtdberr, db3cclose(), DB_WRITECURSOR, and DBIDEBUG.
Return handle for an index database.
rpmdb | rpm database |
rpmtag | rpm tag |
*dbip | index database handle |
Definition at line 2243 of file db3.c.
References _, _debug, _free(), _OFLAGS, alloca(), __db::app_private, cvtdberr, D_, db3Acallback(), db3associate(), db3close(), db3vec, DB_AUTO_COMMIT, DB_BTREE, DB_CREATE, DB_EXCL, DB_HASH, DB_HEAP, db_init(), DB_INIT_TXN, DB_PRIVATE, DB_QUEUE, DB_RECNO, DB_THREAD, DB_UNKNOWN, DB_VERSION_MAJOR, DBIDEBUG, dbiOpen(), errno, EXIT_FAILURE, F_OK, i, mapTagName(), rpmCleanPath(), RPMDBI_PACKAGES, rpmGenPath(), rpmGetPath(), rpmioMkpath(), rpmlog(), RPMLOG_DEBUG, RPMLOG_ERR, RPMLOG_NOTICE, RPMLOG_WARNING, seqid_init(), size, Stat(), stpcpy(), tagName(), tagValue(), Unlink(), urlPath(), and W_OK.
|
static |
|
static |
Definition at line 1626 of file db3.c.
References _debug, _free(), cvtdberr, DB_VERSION_MAJOR, DB_VERSION_MINOR, and DBIDEBUG.
|
static |
|
static |
Definition at line 600 of file db3.c.
References _debug, cvtdberr, D_, DBIDEBUG, rpmlog(), and RPMLOG_DEBUG.
Referenced by db3close().
|
static |
Definition at line 942 of file db3.c.
References _debug, _EFLAGS, _free(), _RPMDB_NLOCKS, cvtdberr, D_, db3_fsync_disable(), DB_CREATE, DB_INIT_LOCK, DB_INIT_MPOOL, DB_INIT_TXN, DBIDEBUG, ncores(), Open(), physmem(), rpmdbe_event_notify(), rpmdbe_feedback(), rpmGenPath(), rpmGetPath(), rpmioMkpath(), rpmlog(), RPMLOG_DEBUG, and tagName().
Referenced by db3open().
|
static |
Definition at line 209 of file db3.c.
References i, name, stpcpy(), and tblName().
Referenced by fmtDBafflags(), fmtDBaflags(), fmtDBCflags(), fmtDBCoflags(), fmtDBeflags(), fmtDBoflags(), and fmtDBT().
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 479 of file db3.c.
References __db_dbt::data, DB_DBT_MULTIPLE, __db_dbt::flags, fmtBits(), i, __db_dbt::size, and xisprint().
Referenced by fmtKDR().
Definition at line 1847 of file db3.c.
References _free(), __db_dbt::data, data, DB_DBT_APPMALLOC, __db_dbt::flags, i, nibble(), ns, pgpExtractPubkeyFingerprint(), RPMTAG_FILEDIGESTS, RPMTAG_PUBKEYS, __db_dbt::size, size, and xmalloc.
Referenced by db3Acallback().
Return (possibly renamed) tagName.
Handles arbitrary tags.
rpmdb | rpm database |
dbi | rpm database index |
Definition at line 583 of file db3.c.
References tagName().
Referenced by db3close(), and db3open().
|
static |
|
inlinestatic |
|
static |
|
static |
Definition at line 919 of file db3.c.
References _events, and __db_env::app_private.
Referenced by db_init().
|
static |
|
static |
|
static |
Definition at line 189 of file db3.c.
References i, key_s::n, and snprintf().
Referenced by fmtBits(), and fmtDBCflags().
|
static |
|
static |
|
static |
Definition at line 555 of file db3.c.
References rpmlog(), and RPMLOG_ERR.
|
static |
Definition at line 7 of file db3.c.
Referenced by db3associate(), db3associate_foreign(), db3cclose(), db3ccount(), db3cdel(), db3cdup(), db3cget(), db3close(), db3copen(), db3cpget(), db3cput(), db3exists(), db3join(), db3open(), db3seqno(), db3stat(), db3sync(), db_fini(), and db_init().
|
static |
Referenced by rpmdbe_event_notify().
struct _dbiVec db3vec |
Definition at line 2836 of file db3.c.
Referenced by db3open().
|
static |
|
static |
|
static |
|
static |
|
static |