rpm  5.4.14
Data Structures | Macros | Typedefs | Functions | Variables
db3.c File Reference
#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"
Include dependency graph for db3.c:

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)
 
 switch (opcode)
 
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)
 
 assert (key->size==sizeof(hdrNum))
 
 assert (dbi)
 
 assert (rpmdb)
 
 if (h==NULL)
 
 memset (_r, 0, sizeof(*_r))
 
 assert (he->p.ptr!=NULL &&he->c > 0)
 
 switch (he->tag)
 
else if (_r->flags &DB_DBT_APPMALLOC)
 
 if ((dbi) ->dbi_debug) fprintf(stderr
 
<--%s(%p,%p,%p,%p) rc%d\n\tdbi%p(%s)
rpmdb%ph%p%s\n",__FUNCTION__,db,key,data,_r,rc,dbi,tagName(dbi-> 
fmtKDR (key, NULL, data, _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 []
 
static void
 
 dbenv = dbenv
 
static int
 
HE_t Fhe = (HE_t) memset(alloca(sizeof(*Fhe)), 0, sizeof(*Fhe))
 
dbiIndex dbi = db->app_private
 
rpmdb rpmdb = NULL
 
Header h = NULL
 
uint32_t hdrNum = _ntoh_ui(hdrNum)
 
DBTA = NULL
 
const char * s = NULL
 
size_t ns = 0
 
int rc = DB_DONOTINDEX
 
uint32_t i
 
int xx
 
goto exit
 
rpmdb db_maxkey = hdrNum
 
exit __pad0__
 
exit Fhe p ptr = _free(Fhe->p.ptr)
 
<--%s(%p,%p,%p,%p) rc%d\n\tdbi%p(%s)
rpmdb%ph%p%s\n",__FUNCTION__,db,key,data,_r,rc,dbi,tagName(dbi-> 
dbi_rpmtag
 
struct _dbiVec db3vec
 
Class: Rpmts
he tag = dbi->dbi_rpmtag
 

Macro Definition Documentation

#define _AFFLAGS (   _afflags)    fmtDBafflags(_afflags)

Definition at line 338 of file db3.c.

Referenced by db3associate_foreign().

#define _AFLAGS (   _aflags)    fmtDBaflags(_aflags)

Definition at line 318 of file db3.c.

Referenced by db3associate().

#define _DBCFLAGS (   _flags)    fmtDBCflags(_flags)

Definition at line 433 of file db3.c.

Referenced by db3cdel(), db3cget(), db3cpget(), and db3cput().

#define _DBCOFLAGS (   _coflags)    fmtDBCoflags(_coflags)

Definition at line 362 of file db3.c.

Referenced by db3copen().

#define _DBT_ENTRY (   _v)    { DB_DBT_##_v, #_v, }

Definition at line 435 of file db3.c.

#define _EFLAGS (   _eflags)    fmtDBeflags(_eflags)

Definition at line 273 of file db3.c.

Referenced by db_init().

#define _ENTRY (   _v)    { DB_##_v, #_v, }

Definition at line 236 of file db3.c.

#define _KEYDATA (   _K,
  _P,
  _D,
  _R 
)    fmtKDR(_K, _P, _D, _R)

Definition at line 550 of file db3.c.

Referenced by db3cdel(), db3cget(), db3cpget(), db3cput(), and db3exists().

#define _OFLAGS (   _oflags)    fmtDBoflags(_oflags)

Definition at line 299 of file db3.c.

Referenced by db3open().

#define _RPMDB_INTERNAL

Definition at line 27 of file db3.c.

#define _RPMDB_NLOCKS   16384

Referenced by db_init().

#define _RPMEVR_INTERNAL   /* XXX isInstallPrereq */

Definition at line 24 of file db3.c.

#define _RPMTAG_INTERNAL

Definition at line 21 of file db3.c.

#define _TABLE (   _v)    { #_v, DB_EVENT_##_v }

Definition at line 736 of file db3.c.

#define cvtdberr (   _dbi,
  _msg,
  _error,
  _printit 
)    Xcvtdberr(_dbi, _msg, _error, _printit, __FUNCTION__, __FILE__, __LINE__)
#define DBIDEBUG (   _dbi,
  _list 
)    if ((_dbi)->dbi_debug) fprintf _list

Typedef Documentation

typedef struct key_s KEY

Function Documentation

static uint32_t _hton_ui ( uint32_t  ui)
inlinestatic

Definition at line 86 of file db3.c.

References _ntoh_ui().

static uint64_t _hton_ul ( uint64_t  ul)
inlinestatic

Definition at line 68 of file db3.c.

References _ntoh_ul().

static uint16_t _hton_us ( uint16_t  us)
inlinestatic

Definition at line 103 of file db3.c.

References _ntoh_us().

static uint32_t _ntoh_ui ( uint32_t  ui)
inlinestatic

Definition at line 74 of file db3.c.

References _dbswap::uc, and _dbswap::ui.

Referenced by _hton_ui().

static uint64_t _ntoh_ul ( uint64_t  ul)
inlinestatic

Definition at line 54 of file db3.c.

References _dbswap::uc, and _dbswap::ul.

Referenced by _hton_ul().

static uint16_t _ntoh_us ( uint16_t  us)
inlinestatic

Definition at line 92 of file db3.c.

References _dbswap::uc, and _dbswap::us.

Referenced by _hton_us().

assert ( key->  size = =sizeof(hdrNum))

Referenced by __fdOpen(), _GetPass(), _processFailedPackage(), _RequestPass(), addSource(), addTE(), arHeaderWrite(), armorFormat(), base64Format(), bncdataFormat(), cdataFormat(), copyEntry(), dataLength(), db3associate(), db3associate_foreign(), db3cdel(), db3cget(), db3copen(), db3cpget(), db3cput(), db3exists(), db3join(), db3open(), db3seqno(), db3stat(), dbiMireKeys(), dbiOpen(), debevrTag(), debmd5sumsTag(), delTE(), depflagsFormat(), deptypeFormat(), digestFormat(), dupMacroEntry(), ensureOlder(), fdFini(), FDGSkip(), fdSeek(), fdStealDigest(), fflagsFormat(), formatValue(), fpCacheCreate(), fpLookupSubdir(), fsmCommitLinks(), fsmMapPath(), fsmStage(), ftpAbort(), ftpFileDone(), ftpNLST(), ftpOpen(), ftpRealpath(), ftpReq(), genCpioListAndHeader(), glob(), handleOverlappedFiles(), hdrKeyList(), headerAppendEntry(), headerCheck(), headerInit(), headerLoad(), headerMacrosLoad(), headerMacrosUnload(), headerMap(), headerMergeLegacySigs(), headerRegenSigHeader(), headerUnload(), headerVerifyInfo(), hintFormat(), httpOpen(), httpReq(), iconvFormat(), IDTXglob(), iosmCommitLinks(), iosmMapPath(), iosmStage(), jsonFormat(), localeTag(), lookupPackage(), main(), makeGPGSignature(), makeHDRSignature(), mireSkip(), needswhatTag(), nwlookupTag(), packageBinaries(), packageSources(), parseBuildInstallClean(), parseForSimple(), parsePreamble(), permsFormat(), pgpDigNew(), pgpsigFormat(), populateInstallHeader(), PRCOSkip(), rdLead(), rdSignature(), regionSwab(), relocateFileList(), removePackage(), rfileHeaderSprintf(), rpmAddSignature(), rpmalAdd(), rpmalAddProvides(), rpmbcExportSignature(), rpmbcMpiItem(), rpmbcSetDSA(), rpmbcSetECDSA(), rpmbcSetELG(), rpmbcSetRSA(), rpmcliAllArgCallback(), rpmcliArgIter(), rpmcliInstall(), rpmdbAdd(), rpmdbExportL10N_SQL(), rpmdbURIPath(), rpmdcArgCallback(), rpmdcPrintCoreutils(), rpmdcPrintFile(), rpmdcPrintZeroInstall(), rpmdsAnyMatchesDep(), rpmdsCompare(), rpmdsDup(), rpmdsDupArgv(), rpmdsELF(), rpmdsEVRorder(), rpmdsMerge(), rpmdsNew(), rpmdsNVRMatchesDep(), rpmdsSysinfoFile(), rpmEVRcmp(), rpmEVRcompare(), rpmEVRmire(), rpmEVRorder(), rpmEVRparse(), rpmfcApply(), rpmfcClassify(), rpmfcFileDep(), rpmfcGenerateDepends(), rpmfcHelper(), rpmfcPrint(), rpmfiFNBF(), rpmfiNew(), rpmheRealloc(), rpmInstallSourcePackage(), rpmiobAppend(), rpmiobBuf(), rpmiobEmpty(), rpmiobRTrim(), rpmiobStr(), rpmioFreePool(), rpmioFreePoolItem(), rpmioGetPool(), rpmmc_list(), rpmmiAddPattern(), rpmmiCount(), rpmmiFini(), rpmmiGrowBasename(), rpmmiInit(), rpmmiNext(), rpmmiPrune(), rpmpsmScriptStage(), rpmpsmSetAsync(), rpmpsmStage(), rpmReadPackageFile(), rpmrepoInitPopt(), rpmrepoOpenMDFile(), rpmRollback(), rpmSetMachine(), rpmsqlRun(), rpmsqWaitUnregister(), rpmteChain(), rpmteColorDS(), rpmtsAddInstallElement(), rpmtsAddObsoletes(), rpmtsAddUpgrades(), rpmtsEraseDebuginfo(), rpmtsFindPubkey(), rpmtsFini(), rpmtsRepackage(), rpmtsRunScript(), rpmVerifySignatures(), rpmvfVerify(), rpmvtNew(), rpmxarNew(), runImmedTriggers(), runInstScript(), runScript(), runTriggers(), showQueryPackage(), singleSprintf(), spewescapeFormat(), sql_bind_data(), sql_bind_key(), sql_cdel(), sql_cget(), sql_cput(), sql_step(), statFormat(), str2uuid(), strdup_iconv_check(), szHeader(), tag2uuidv5(), tagLoadIndex(), tagSwab(), triggertypeFormat(), ufdClose(), ufdOpen(), ufdRead(), urlConnect(), urlFind(), urlSplit(), uuidFormat(), verifyDependencies(), whatneedsTag(), while(), wnlookupTag(), writeRPM(), xarRead(), xmlFormat(), and yamlFormat().

assert ( dbi  )
assert ( rpmdb  )
assert ( he->p.ptr!  = NULL &&he->c,
 
)
static int db3_fsync_disable ( int  fd)
static

Definition at line 641 of file db3.c.

Referenced by db_init().

static int db3associate ( dbiIndex  dbi,
dbiIndex  dbisecondary,
int(*)(DB *, const DBT *, const DBT *, DBT *)  callback,
unsigned int  flags 
)
static

Definition at line 1623 of file db3.c.

References _AFLAGS, _debug, _free(), assert(), cvtdberr, fprintf(), NULL, rc, tagName(), and xstrdup().

Referenced by db3open().

static int db3associate_foreign ( dbiIndex  dbi,
dbiIndex  dbisecondary,
int(*)(DB *, const DBT *, DBT *, const DBT *, int *)  callback,
unsigned int  flags 
)
static

Definition at line 1652 of file db3.c.

References _AFFLAGS, _debug, _free(), assert(), cvtdberr, fprintf(), NULL, rc, tagName(), and xstrdup().

static int db3byteswapped ( dbiIndex  dbi)
static

Definition at line 1576 of file db3.c.

References if(), NULL, and rc.

static int db3cclose ( dbiIndex  dbi,
DBC dbcursor,
unsigned int  flags 
)
static

Definition at line 1353 of file db3.c.

References _debug, cvtdberr, DBIDEBUG, NULL, and rc.

Referenced by db3copen().

static int db3ccount ( dbiIndex  dbi,
DBC dbcursor,
unsigned int countp,
unsigned int  flags 
)
static

Definition at line 1552 of file db3.c.

References _debug, count, cvtdberr, DBIDEBUG, and rc.

static int db3cdel ( dbiIndex  dbi,
DBC dbcursor,
DBT key,
DBT data,
unsigned int  flags 
)
static

Definition at line 1518 of file db3.c.

References _DBCFLAGS, _debug, _KEYDATA, assert(), cvtdberr, db3cget(), DB_SET, DBIDEBUG, NULL, and rc.

static int db3cdup ( dbiIndex  dbi,
DBC dbcursor,
DBC **  dbcp,
unsigned int  flags 
)
static

Definition at line 1331 of file db3.c.

References _debug, cvtdberr, DBIDEBUG, NULL, and rc.

static int db3cget ( dbiIndex  dbi,
DBC dbcursor,
DBT key,
DBT data,
unsigned int  flags 
)
static

Definition at line 1438 of file db3.c.

References _DBCFLAGS, _debug, _KEYDATA, assert(), cvtdberr, DB_BUFFER_SMALL, DB_NOTFOUND, DBIDEBUG, NULL, and rc.

Referenced by db3cdel().

static int db3close ( dbiIndex  dbi,
unsigned int  flags 
)
static

Definition at line 1702 of file db3.c.

References _debug, _free(), cvtdberr, D_, db_fini(), DBIDEBUG, mapTagName(), NULL, rc, rpmGenPath(), rpmlog(), RPMLOG_DEBUG, urlPath(), void, and xx.

Referenced by db3open().

static int db3copen ( dbiIndex  dbi,
DB_TXN txnid,
DBC **  dbcp,
unsigned int  dbiflags 
)
static

Definition at line 1377 of file db3.c.

References _DBCOFLAGS, _debug, assert(), cvtdberr, db3cclose(), DB_WRITECURSOR, DBIDEBUG, NULL, and rc.

static int db3cpget ( dbiIndex  dbi,
DBC dbcursor,
DBT key,
DBT pkey,
DBT data,
unsigned int  flags 
)
static

Definition at line 1479 of file db3.c.

References _DBCFLAGS, _debug, _KEYDATA, assert(), cvtdberr, DB_NOTFOUND, DBIDEBUG, NULL, and rc.

static int db3cput ( dbiIndex  dbi,
DBC dbcursor,
DBT key,
DBT data,
unsigned int  flags 
)
static

Definition at line 1408 of file db3.c.

References _DBCFLAGS, _debug, _KEYDATA, assert(), cvtdberr, DB_KEYLAST, DBIDEBUG, NULL, and rc.

static int db3exists ( dbiIndex  dbi,
DBT key,
unsigned int  flags 
)
static

Definition at line 1278 of file db3.c.

References _debug, _KEYDATA, assert(), cvtdberr, DB_NOTFOUND, DBIDEBUG, NULL, and rc.

static int db3join ( dbiIndex  dbi,
DBC **  curslist,
DBC **  dbcp,
unsigned int  flags 
)
static

Definition at line 1683 of file db3.c.

References _debug, assert(), cvtdberr, DBIDEBUG, NULL, and rc.

static int db3open ( rpmdb  rpmdb,
rpmTag  rpmtag,
dbiIndex dbip 
)
static
static int db3seqno ( dbiIndex  dbi,
int64_t *  seqnop,
unsigned int  flags 
)
static

Definition at line 1300 of file db3.c.

References _debug, assert(), cvtdberr, DBIDEBUG, exit, NULL, and rc.

static int db3stat ( dbiIndex  dbi,
unsigned int  flags 
)
static

Definition at line 1591 of file db3.c.

References _debug, _free(), assert(), cvtdberr, DB_VERSION_MAJOR, DB_VERSION_MINOR, DBIDEBUG, if(), NULL, and rc.

static int db3sync ( dbiIndex  dbi,
unsigned int  flags 
)
static

Definition at line 1259 of file db3.c.

References _debug, cvtdberr, DBIDEBUG, if(), NULL, and rc.

static int db_fini ( dbiIndex  dbi,
const char *  dbhome,
const char *  dbfile,
const char *  dbsubfile 
)
static

Definition at line 598 of file db3.c.

References _debug, cvtdberr, D_, dbenv, DBIDEBUG, NULL, rc, rpmlog(), RPMLOG_DEBUG, and xx.

Referenced by db3close().

static int db_init ( dbiIndex  dbi,
const char *  dbhome,
const char *  dbfile,
const char *  dbsubfile,
DB_ENV **  dbenvp 
)
static
static const char* fmtBits ( uint32_t  flags,
KEY  tbl[],
size_t  ntbl,
char *  t 
)
static

Definition at line 209 of file db3.c.

References i, name, sprintf(), stpcpy(), t, and tblName().

Referenced by fmtDBafflags(), fmtDBaflags(), fmtDBCflags(), fmtDBCoflags(), fmtDBeflags(), fmtDBoflags(), and fmtDBT().

static const char* fmtDBafflags ( uint32_t  flags)
static

Definition at line 329 of file db3.c.

References buf, fmtBits(), stpcpy(), and void.

static const char* fmtDBaflags ( uint32_t  flags)
static

Definition at line 309 of file db3.c.

References buf, fmtBits(), stpcpy(), and void.

static const char* fmtDBCflags ( uint32_t  flags)
static

Definition at line 415 of file db3.c.

References buf, fmtBits(), op, stpcpy(), tblName(), and void.

static const char* fmtDBCoflags ( uint32_t  flags)
static

Definition at line 354 of file db3.c.

References buf, fmtBits(), and void.

static const char* fmtDBeflags ( uint32_t  flags)
static

Definition at line 264 of file db3.c.

References buf, fmtBits(), stpcpy(), and void.

static const char* fmtDBoflags ( uint32_t  flags)
static

Definition at line 290 of file db3.c.

References buf, fmtBits(), stpcpy(), and void.

static char* fmtDBT ( const DBT K,
char *  te 
)
static

Definition at line 477 of file db3.c.

References __db_dbt::data, DB_DBT_MULTIPLE, ellipsis, __db_dbt::flags, fmtBits(), i, nb, __db_dbt::size, sprintf(), te, void, and xisprint().

Referenced by fmtKDR().

static const char* fmtKDR ( const DBT K,
const DBT P,
const DBT D,
const DBT R 
)
static

Definition at line 524 of file db3.c.

References buf, fmtDBT(), and stpcpy().

<--%s(%p,%p,%p,%p)rc%d\n\tdbi%p(%s)rpmdb%ph%p%s\n",__FUNCTION__,db,key,data,_r,rc,dbi,tagName(dbi-> fmtKDR ( key  ,
NULL  ,
data  ,
_r   
)
if ( h  = NULL)

Definition at line 1914 of file db3.c.

References _, __db_dbt::data, exit, headerLoad(), NULL, rpmlog(), and RPMLOG_ERR.

else if ( _r->flags DB_DBT_APPMALLOC)

Definition at line 2108 of file db3.c.

References _free(), __db_dbt::data, and memset().

if ( (dbi) ->  dbi_debug)
static int loadDBT ( DBT _r,
rpmTag  tag,
const void _s,
size_t  ns 
)
static
static const char* mapTagName ( rpmdb  rpmdb,
dbiIndex  dbi 
)
static

Return (possibly renamed) tagName.

Handles arbitrary tags.

Parameters
rpmdbrpm database
dbirpm database index
Returns
tag string

Definition at line 581 of file db3.c.

References NULL, and tagName().

Referenced by db3close(), and db3open().

memset ( _r  ,
,
sizeof *  _r 
)

Referenced by _GetPass(), addChangelogEntry(), addFile(), addFileToArrayTag(), addFileToTag(), addOrAppendListEntry(), addReqProv(), addTE(), argiAdd(), arHeaderWrite(), cacheStashLatest(), checkForDuplicates(), checkPackageSet(), compressFilelist(), cpioTrailerWrite(), ctxFini(), ctxGetPool(), currentDirectory(), dateToTimet(), db3open(), dbiAppendSet(), dbiMireKeys(), debevrTag(), debmd5sumsTag(), digGetPool(), doIcon(), doPatchMacro(), doScript(), ensureOlder(), fdGetPool(), fiIntersect(), fillOutMainPackage(), findErases(), formatValue(), fsmSetup(), fsmStage(), Fstat(), ftpReq(), fts_alloc(), Fts_open(), fts_stat(), ftsCacheUpdate(), genCpioListAndHeader(), getDigestAlgo(), getSignid(), handleInstInstalledFile(), handleOneTrigger(), handlePreambleTag(), hCopyTag(), hdr_subscript(), hdrKeyList(), headerCheck(), headerCopy(), headerCopyTags(), headerGet(), headerGetPool(), headerLoad(), headerMacrosLoad(), headerMacrosUnload(), headerMergeLegacySigs(), headerNEVRA(), headerNew(), headerNext(), headerRegenSigHeader(), headerSetMagic(), headerSprintf(), headerUnload(), hGetColor(), hLoadTID(), hSaveBlinks(), hSaveFlinks(), i18nTag(), IDTXglob(), IDTXload(), if(), initSourceHeader(), initSourceHeaderScriptlet(), iosmSetup(), iosmStage(), isMemberInEntry(), lookupPackage(), main(), makeGPGSignature(), makeHDRSignature(), mireAppend(), mireGetPool(), mireSkip(), needswhatTag(), newSpec(), nwlookupTag(), packageBinaries(), packageSources(), parseDescription(), parseForRegexLang(), parsePreamble(), parseRCPOT(), parseScript(), parseSpec(), pgpDigClean(), pgpMpiSet(), pgpPktLen(), pgpPrtPkt(), pkgGetPool(), pkgUnpackagedSubdirs(), pointRpmEVR(), populateInstallHeader(), postPopulateInstallHeader(), processBinaryFiles(), processMetadataFile(), processPackageFiles(), processScriptFiles(), processSourceFiles(), providePackageNVR(), rdSignature(), readFile(), regionSwab(), relocateFileList(), removeSillyDeps(), rpmAddSignature(), rpmalAllSatisfiesDepend(), rpmalDel(), rpmalGetPool(), rpmbcSetRSA(), rpmCheckPassPhrase(), rpmcliImportPubkey(), rpmcliInstall(), rpmdbAdd(), rpmdbExportHR_MIB(), rpmdbGetPool(), rpmdbNew(), rpmdbRemove(), rpmDefineMacro(), rpmDigestFinal(), rpmdsCompare(), rpmdsFini(), rpmdsFreePRCO(), rpmdsGetPool(), rpmdsNew(), rpmdsNext(), rpmdsNVRMatchesDep(), rpmdsSysinfo(), rpmdsThis(), rpmEVRfree(), rpmEVRparse(), rpmfcGenerateDepends(), rpmfcGenerateScriptletDeps(), rpmfcGetPool(), rpmfi_FDigest_get(), rpmfiBuildFNames(), rpmfiDecideFate(), rpmfiFStat(), rpmfiGetPool(), rpmfiNew(), rpmFreeMacros(), rpmgiGetPool(), rpmhdrLoadTag(), rpmHeadersIdentical(), rpmheClean(), rpmInstallSourcePackage(), rpmlibMarkers(), rpmmiAddPattern(), rpmmiGet(), rpmmiGetPool(), rpmmiInit(), rpmnsProbeSignature(), rpmpsAppend(), rpmpsmGetPool(), rpmpsmNew(), rpmpsmStage(), rpmQueryVerify(), rpmrbLoadClasses(), rpmReadHeader(), rpmReadPackageFile(), rpmrepoGetPool(), rpmrepoRfileDigest(), rpmReSign(), rpmsqlGetPool(), rpmsqlNew(), rpmteChain(), rpmteColorDS(), rpmteGetPool(), rpmteNew(), rpmtsAddInstallElement(), rpmtsAddUpgrades(), rpmtsCallback(), rpmtsCheckInstalledFiles(), rpmtsCreate(), rpmtsEraseDebuginfo(), rpmtsFindPubkey(), rpmtsGetPool(), rpmtsiGetPool(), rpmtsInitDSI(), rpmtsRollback(), rpmtsSanityCheck(), rpmtsSkipFiles(), rpmtsSolve(), rpmvcGetPool(), rpmVerifySignatures(), rpmVersionCompare(), rpmvfVerify(), rpmvtGetPool(), rpmxarGetPool(), rpmxarStat(), rpnFormat(), runImmedTriggers(), runInstScript(), runScript(), saveHardLink(), scpGetPool(), scpResetAv(), specGetPool(), stashSt(), statFormat(), tarHeaderRead(), tarHeaderWrite(), tarHeaderWriteBlock(), tcpConnect(), timeCheck(), triggercondsTag(), triggertypeTag(), unsatisfiedDepend(), urlGetPool(), uuidFormat(), whatneedsTag(), wnlookupTag(), writeRPM(), XfdNew(), and XpoptParseArgvString().

static size_t ncores ( void  )
static

Definition at line 711 of file db3.c.

References name, and NULL.

Referenced by db_init().

static unsigned char nibble ( char  c)
inlinestatic

Convert hex to binary nibble.

Parameters
chex character
Returns
binary nibble

Definition at line 1800 of file db3.c.

References int.

Referenced by loadDBT().

static uint64_t physmem ( void  )
static

Definition at line 681 of file db3.c.

References name, and NULL.

Referenced by db_init().

static void rpmdbe_event_notify ( DB_ENV dbenv,
u_int32_t  event,
void event_info 
)
static

Definition at line 884 of file db3.c.

References _events, __db_env::app_private, fprintf(), n, NULL, and o.

Referenced by db_init().

static int seqid_init ( dbiIndex  dbi,
const char *  keyp,
size_t  keylen,
DB_SEQUENCE **  seqp 
)
static

Definition at line 2128 of file db3.c.

Referenced by db3open().

switch ( opcode  )

Definition at line 896 of file db3.c.

References fprintf(), and void.

Referenced by rpmbcMpiItem(), and rpmQVSourceArgCallback().

switch ( he->  tag)
static const char* tblName ( uint32_t  v,
KEY tbl,
size_t  ntbl 
)
static

Definition at line 189 of file db3.c.

References buf, i, key_s::n, n, NULL, snprintf(), unsigned, and void.

Referenced by fmtBits(), and fmtDBCflags().

static int uint32Cmp ( const void _a,
const void _b 
)
static

Definition at line 1858 of file db3.c.

References b.

static int uint64Cmp ( const void _a,
const void _b 
)
static

Definition at line 1867 of file db3.c.

References b.

static int Xcvtdberr ( dbiIndex  dbi,
const char *  msg,
int  error,
int  printit,
const char *  func,
const char *  fn,
unsigned  ln 
)
static

Definition at line 553 of file db3.c.

References rc, rpmlog(), and RPMLOG_ERR.

Variable Documentation

exit __pad0__

Definition at line 2115 of file db3.c.

int _debug = 1
static
union _dbswap _endian = { .ui = 0x11223344 }
static

Definition at line 52 of file db3.c.

struct _events_s _events[]
static

Referenced by rpmdbe_event_notify().

DBT* A = NULL

Definition at line 1890 of file db3.c.

Referenced by cmpArgvStr(), hGetNVRA(), rpmdsA(), rpmdsNewDNEVR(), and rpmHeadersIdentical().

rpmdb db_maxkey = hdrNum

Definition at line 1911 of file db3.c.

KEY DBafflags[]
static
Initial value:
= {
{ DB_FOREIGN_ABORT , "FOREIGN_ABORT", },
{ DB_FOREIGN_CASCADE , "FOREIGN_CASCADE", },
{ DB_FOREIGN_NULLIFY , "FOREIGN_NULLIFY", },
}

Definition at line 321 of file db3.c.

KEY DBaflags[]
static
Initial value:
= {
{ DB_CREATE , "CREATE", },
{ DB_IMMUTABLE_KEY , "IMMUTABLE_KEY", },
}
#define DB_CREATE
Definition: db_emu.h:113

Definition at line 302 of file db3.c.

KEY DBCflags[]
static

Definition at line 365 of file db3.c.

KEY DBCoflags[]
static
Initial value:
= {
{ DB_READ_COMMITTED , "READ_COMMITTED", },
{ DB_READ_UNCOMMITTED , "READ_UNCOMMITTED", },
{ DB_WRITECURSOR , "WRITECURSOR", },
{ DB_TXN_SNAPSHOT , "TXN_SNAPSHOT", },
}
#define DB_WRITECURSOR
Definition: db_emu.h:91

Definition at line 341 of file db3.c.

KEY DBeflags[]
static
Initial value:
= {
{ DB_INIT_CDB , "INIT_CDB", },
{ DB_INIT_LOCK , "INIT_LOCK", },
{ DB_INIT_LOG , "INIT_LOG", },
{ DB_INIT_MPOOL , "INIT_MPOOL", },
{ DB_INIT_MUTEX , "INIT_MUTEX", },
{ DB_INIT_REP , "INIT_REP", },
{ DB_INIT_TXN , "INIT_TXN", },
{ DB_RECOVER , "RECOVER", },
{ DB_RECOVER_FATAL , "RECOVER_FATAL", },
{ DB_USE_ENVIRON , "USE_ENVIRON", },
{ DB_USE_ENVIRON_ROOT , "USE_ENVIRON_ROOT", },
{ DB_CREATE , "CREATE", },
{ DB_LOCKDOWN , "LOCKDOWN", },
{ DB_PRIVATE , "PRIVATE", },
{ DB_REGISTER , "REGISTER", },
{ DB_SYSTEM_MEM , "SYSTEM_MEM", },
{ DB_THREAD , "THREAD", },
}
#define DB_THREAD
Definition: db_emu.h:119
#define DB_CREATE
Definition: db_emu.h:113
#define DB_INIT_TXN
Definition: db_emu.h:117
#define DB_INIT_LOG
Definition: db_emu.h:115
#define DB_INIT_LOCK
Definition: db_emu.h:114
#define DB_PRIVATE
Definition: db_emu.h:98
#define DB_INIT_MPOOL
Definition: db_emu.h:116

Definition at line 239 of file db3.c.

dbenv = dbenv

Definition at line 895 of file db3.c.

Referenced by db3open(), db_fini(), and db_init().

dbiIndex dbi = db->app_private
<--%s(%p,%p,%p,%p)rc%d\n\tdbi%p(%s)rpmdb%ph%p%s\n",__FUNCTION__,db,key,data,_r,rc,dbi,tagName(dbi-> dbi_rpmtag

Definition at line 2123 of file db3.c.

KEY DBoflags[]
static
Initial value:
= {
{ DB_AUTO_COMMIT , "AUTO_COMMIT", },
{ DB_CREATE , "CREATE", },
{ DB_EXCL , "EXCL", },
{ DB_MULTIVERSION , "MULTIVERSION", },
{ DB_NOMMAP , "NOMMAP", },
{ DB_RDONLY , "RDONLY", },
{ DB_READ_UNCOMMITTED , "READ_UNCOMMITTED", },
{ DB_THREAD , "THREAD", },
{ DB_TRUNCATE , "TRUNCATE", },
}
#define DB_THREAD
Definition: db_emu.h:119
#define DB_CREATE
Definition: db_emu.h:113
#define DB_EXCL
Definition: db_emu.h:97
#define DB_AUTO_COMMIT
Definition: db_emu.h:118

Definition at line 276 of file db3.c.

KEY DBTflags[]
static

Definition at line 437 of file db3.c.

goto exit

Definition at line 1903 of file db3.c.

Referenced by _rpmtsCheck(), _rpmtsRun(), _specQuery(), _tagValue(), Access(), addFile(), argerror(), base64Format(), buildSpec(), cacheStashLatest(), checkForValidArchitectures(), checkUnpackagedFiles(), Chmod(), Chown(), compressFilelist(), copyFile(), db3open(), db3seqno(), dbiFindMatches(), dbiMireKeys(), dbiOpen(), debevrTag(), debmd5sumsTag(), digestFormat(), dodigest(), doIcon(), doSetupMacro(), evrSplit(), extractRegular(), Fchmod(), Fchown(), FDGsqlTag(), FDGxmlTag(), FDGyamlTag(), filestatTag(), findErases(), Fopen(), for(), formatValue(), fpLookupSubdir(), fssizesTag(), Fstat(), ftpNLST(), ftpOpen(), Fts_read(), getOutputFrom(), grabArgs(), handleOneTrigger(), headerCheck(), headerSprintf(), httpOpen(), if(), isPart(), jsonFormat(), Lchmod(), Lchown(), lookupPackage(), Lstat(), Lutimes(), main(), makeHDRSignature(), mireLoadPatterns(), mireRegcomp(), mireSetLocale(), mireStudy(), Mkfifo(), Mknod(), mtree_error(), needswhatTag(), open_dso(), packageBinaries(), parseDescription(), parseFiles(), parseForDev(), parseForSimple(), parseRCPOT(), parseScript(), parseSimplePart(), pgpArmorUnwrap(), PRCOsqlTag(), PRCOxmlTag(), PRCOyamlTag(), processBinaryFile(), processMetadataFile(), processPackageFiles(), processSourceFiles(), providePackageNVR(), rdLead(), rdSignature(), readFile(), Readlink(), rpmalAllFileSatisfiesDepend(), rpmalAllSatisfiesDepend(), rpmbcSetRSA(), rpmcliAllArgCallback(), rpmcliConfigured(), rpmcliImportPubkey(), rpmcliInstall(), rpmcliInstallElementPath(), rpmcliWalkFirst(), rpmdbAdd(), rpmdbCheckSignals(), rpmdbExportHR_MIB(), rpmdbExportL10N_SQL(), rpmdbOpenDatabase(), rpmdbRemove(), rpmdcArgCallback(), rpmdcInitFile(), rpmdcParseCoreutils(), rpmdcParseZeroInstall(), rpmdsAnyMatchesDep(), rpmdsCompare(), rpmdsCpuinfo(), rpmdsELF(), rpmdsLdconfig(), rpmdsNew(), rpmdsNVRMatchesDep(), rpmdsPipe(), rpmdsSysinfo(), rpmdsSysinfoFile(), rpmdsUname(), rpmfcExec(), rpmfcExpandRegexps(), rpmfiBuildFClasses(), rpmfiBuildFDeps(), rpmfiNew(), rpmGetFilesystemUsage(), rpmgiNext(), rpmGlob(), rpmhdrLoadTag(), rpmInstallSource(), rpmInstallSourcePackage(), rpmioAccess(), rpmioAllArgCallback(), rpmiobSlurp(), rpmioConfigured(), rpmioInit(), rpmioParse(), rpmjsRun(), rpmjsRunFile(), rpmLoadMacroFile(), rpmmiAddPattern(), rpmmiGrowBasename(), rpmmiInit(), rpmnsProbeSignature(), rpmPlatform(), rpmReadHeader(), rpmReadPackageFile(), rpmReadPackageManifest(), rpmrepoError(), rpmrepoRfileDigest(), rpmReSign(), rpmRollback(), rpmspecQuery(), rpmteOpen(), rpmts_Die(), rpmtsAddInstallElement(), rpmtsFindPubkey(), rpmtsOpenSDB(), rpmtsPrepare(), rpmtsRebuildDB(), rpmtsSolve(), rpmuuidMake(), rpmVerifySignature(), rpmVerifySignatures(), rpmvfVerify(), rpmWriteHeader(), rpnFormat(), runImmedTriggers(), runInstScript(), runScript(), showQueryPackage(), sql_cget(), sql_initDB(), sql_open(), Stat(), statFormat(), stemEnd(), strsubFormat(), Symlink(), triggercondsTag(), triggertypeTag(), Unlink(), unsatisfiedDepend(), urlGetFile(), Utime(), Utimes(), uuidFormat(), vmefail(), vrpmlog(), whatneedsTag(), while(), writeFile(), writeRPM(), xmlFormat(), XpoptParseArgvString(), and yamlFormat().

HE_t Fhe = (HE_t) memset(alloca(sizeof(*Fhe)), 0, sizeof(*Fhe))

Definition at line 1882 of file db3.c.

Referenced by debevrTag(), and triggercondsTag().

<--%s(%p,%p,%p,%p)rc%d\n\tdbi%p(%s)rpmdb%ph%p%s\n",__FUNCTION__,db,key,data,_r,rc,dbi,tagName(dbi-> h = NULL

Definition at line 1888 of file db3.c.

memcpy & hdrNum = _ntoh_ui(hdrNum)
uint32_t i

Definition at line 1894 of file db3.c.

int
static
Initial value:
{
HE_t he = (HE_t) memset(alloca(sizeof(*he)), 0, sizeof(*he))
char * alloca()
memset(_r, 0, sizeof(*_r))
struct _HE_s * HE_t
Destroy an extension cache.
Definition: rpmtag.h:59
Definition: rpmtag.h:500

Definition at line 1880 of file db3.c.

size_t nDBafflags = sizeof(DBafflags) / sizeof(DBafflags[0])
static

Definition at line 327 of file db3.c.

size_t nDBaflags = sizeof(DBaflags) / sizeof(DBaflags[0])
static

Definition at line 307 of file db3.c.

size_t nDBCflags = sizeof(DBCflags) / sizeof(DBCflags[0])
static

Definition at line 412 of file db3.c.

size_t nDBCoflags = sizeof(DBCoflags) / sizeof(DBCoflags[0])
static

Definition at line 352 of file db3.c.

size_t nDBeflags = sizeof(DBeflags) / sizeof(DBeflags[0])
static

Definition at line 262 of file db3.c.

size_t nDBoflags = sizeof(DBoflags) / sizeof(DBoflags[0])
static

Definition at line 288 of file db3.c.

size_t nDBTflags = sizeof(DBTflags) / sizeof(DBTflags[0])
static

Definition at line 474 of file db3.c.

size_t ns = 0
he p ptr = _free(Fhe->p.ptr)
return rc = DB_DONOTINDEX

Definition at line 1893 of file db3.c.

<--%s(%p,%p,%p,%p)rc%d\n\tdbi%p(%s)rpmdb%ph%p%s\n",__FUNCTION__,db,key,data,_r,rc,dbi,tagName(dbi-> rpmdb = NULL

Definition at line 1887 of file db3.c.

const char* s = NULL

Definition at line 1891 of file db3.c.

int tag = dbi->dbi_rpmtag
void
static
Initial value:
{
dbenv
Definition: db3.c:895
return NULL
Definition: poptALL.c:613

Definition at line 893 of file db3.c.

Referenced by db3close(), db3open(), db_init(), fmtDBafflags(), fmtDBaflags(), fmtDBCflags(), fmtDBCoflags(), fmtDBeflags(), fmtDBoflags(), fmtDBT(), switch(), and tblName().

int xx

Definition at line 1895 of file db3.c.