rpm  5.4.14
Data Structures | Macros | Typedefs | Functions | Variables
#include "system.h"
#include <sys/file.h>
#include <rpmiotypes.h>
#include <rpmlog.h>
#include <rpmpgp.h>
#include <rpmurl.h>
#include <rpmhash.h>
#include <rpmmacro.h>
#include <rpmsq.h>
#include <rpmsx.h>
#include <argv.h>
#include <rpmbf.h>
#include <rpmtypes.h>
#include "header_internal.h"
#include "rpmdb.h"
#include "pkgio.h"
#include "fprint.h"
#include "legacy.h"
#include "debug.h"
#include "wdj_l10n_sqlite"
Include dependency graph for rpmdb.c:

Go to the source code of this file.

Data Structures

union  _dbswap
 
struct  _setSwap_s
 
struct  rpmmi_s
 

Macros

#define _MIRE_INTERNAL
 
#define _RPMBF_INTERNAL
 
#define _RPMTAG_INTERNAL
 
#define _RPMDB_INTERNAL
 
#define UINT32_T   rpmuint32_t
 
#define _DBI_FLAGS   0
 
#define _DBI_PERMS   0644
 
#define _DBI_MAJOR   -1
 
#define DB1vec   NULL
 
#define DB2vec   NULL
 
#define DB3vec   NULL
 
#define SQLITEvec   NULL
 
#define _DB_ROOT   "/"
 
#define _DB_HOME   "%{?_dbpath}"
 
#define _DB_FLAGS   0
 
#define _DB_MODE   0
 
#define _DB_PERMS   0644
 
#define _DB_MAJOR   3
 
#define _DB_ERRPFX   "rpmdb"
 

Typedefs

typedef struct _setSwap_ssetSwap
 

Functions

static size_t dbiTagToDbix (rpmdb db, rpmTag tag)
 Return dbi index used for rpm tag. More...
 
static void dbiTagsInit (tagStore_t *dbiTagsP, size_t *dbiNTagsP)
 Initialize database (index, tag) tuple from configuration. More...
 
static int checkfd (const char *devnull, int fdno, int flags)
 
dbiIndex dbiOpen (rpmdb db, rpmTag tag, unsigned int flags)
 
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 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. More...
 
unsigned int dbiIndexSetCount (dbiIndexSet set)
 
uint32_t dbiIndexRecordOffset (dbiIndexSet set, unsigned int recno)
 
uint32_t dbiIndexRecordFileNumber (dbiIndexSet set, unsigned int recno)
 
dbiIndexSet dbiFreeIndexSet (dbiIndexSet set)
 
int rpmdbCheckTerminate (int terminate)
 Check rpmdb signal handler for trapped signal and/or requested exit. More...
 
int rpmdbCheckSignals (void)
 Check for and exit on termination signals. More...
 
static int blockSignals (rpmdb db, sigset_t *oldMask)
 Block all signals, returning previous signal mask. More...
 
static int unblockSignals (rpmdb db, sigset_t *oldMask)
 Restore signal mask. More...
 
static const char * queryHeader (Header h, const char *qfmt)
 Return header query string. More...
 
static int rpmdbExportHR_MIB (rpmdb db, Header h, int adding)
 Write added/removed header info into %{_hrmib_path}. More...
 
static int rpmdbExportL10N_SQL (rpmdb db, Header h, int adding)
 Update added header info into %{__l10ndir} sqlite3 database. More...
 
static int rpmdbExportInfo (rpmdb db, Header h, int adding)
 Write added/removed header info. More...
 
static rpmdb rpmdbGetPool (rpmioPool pool)
 
int rpmdbOpenAll (rpmdb db)
 Open all database indices. More...
 
int rpmdbBlockDBI (rpmdb db, int tag)
 Block access to a single database index. More...
 
int rpmdbCloseDBI (rpmdb db, int tag)
 Close a single database index. More...
 
int rpmdbClose (rpmdb db)
 Close all database indices and free rpmdb. More...
 
static const char * rpmdbURIPath (const char *uri)
 Return macro expanded absolute path to rpmdb. More...
 
rpmdb rpmdbNew (const char *root, const char *home, int mode, mode_t perms, int flags)
 
static int rpmdbOpenDatabase (const char *prefix, const char *dbpath, int _dbapi, rpmdb *dbp, int mode, mode_t perms, int flags)
 
int rpmdbOpen (const char *prefix, rpmdb *dbp, int mode, mode_t perms)
 Open rpm database. More...
 
int rpmdbCount (rpmdb db, rpmTag tag, const void *keyp, size_t keylen)
 Return number of instances of key in a tag index. More...
 
int rpmdbCountPackages (rpmdb db, const char *N)
 Return number of instances of package in Name index. More...
 
static const char * stemEnd (const char *s)
 
static const char * _str2PCREpat (const char *_pre, const char *s, const char *_post)
 
static int dbiMireKeys (rpmdb db, rpmTag tag, rpmMireMode mode, const char *pat, dbiIndexSet *matches, const char ***argvp)
 Retrieve prinary/secondary keys for a pattern match. More...
 
int rpmdbMireApply (rpmdb db, rpmTag tag, rpmMireMode mode, const char *pat, const char ***argvp)
 Return array of keys matching a pattern. More...
 
int rpmmiGrowBasename (rpmmi mi, const char *bn)
 Append packages containing common basename to iterator. More...
 
static rpmRC dbiFindMatches (dbiIndex dbi, const char *pat, dbiIndexSet *matches)
 Attempt partial matches on name[-version[-release]] strings. More...
 
voiddbiStatsAccumulator (dbiIndex dbi, int opx)
 
static int miFreeHeader (rpmmi mi, dbiIndex dbi)
 Rewrite a header into packages (if necessary) and free the header. More...
 
static void rpmmiFini (void *_mi)
 
static rpmmi rpmmiGetPool (rpmioPool pool)
 
uint32_t rpmmiInstance (rpmmi mi)
 Return header instance for current position of rpmdb iterator. More...
 
uint32_t rpmmiBNTag (rpmmi mi)
 Return basename tag for current position of rpmdb iterator. More...
 
unsigned int rpmmiCount (rpmmi mi)
 Return number of elements in rpm database iterator. More...
 
static int mireCmp (const void *a, const void *b)
 Compare iterator selectors by rpm tag (qsort/bsearch). More...
 
static char * mireDup (rpmTag tag, rpmMireMode *modep, const char *pattern)
 Copy pattern, escaping for appropriate mode. More...
 
int rpmmiAddPattern (rpmmi mi, rpmTag tag, rpmMireMode mode, const char *pattern)
 Add pattern to iterator selector. More...
 
static unsigned char nibble (char c)
 Convert hex to binary nibble. More...
 
static char * bin2hex (const void *data, size_t size)
 Convert binary blob to printable hex string. More...
 
static int mireSkip (const rpmmi mi)
 Return iterator selector match. More...
 
int rpmmiSetRewrite (rpmmi mi, int rewrite)
 Prepare iterator for lazy writes. More...
 
int rpmmiSetModified (rpmmi mi, int modified)
 Modify iterator to mark header for lazy write on release. More...
 
static int rpmmiGet (dbiIndex dbi, DBC *dbcursor, DBT *kp, DBT *pk, DBT *vp, unsigned int flags)
 
Header rpmmiNext (rpmmi mi)
 Return next package header from iteration. More...
 
int rpmmiSort (rpmmi mi)
 Sort iterator instances. More...
 
int rpmmiPrune (rpmmi mi, uint32_t *hdrNums, int nHdrNums, int sorted)
 Remove items from set of package instances to iterate. More...
 
int rpmmiGrow (rpmmi mi, const uint32_t *hdrNums, int nHdrNums)
 Append items to set of package instances to iterate. More...
 
rpmmi rpmmiInit (rpmdb db, rpmTag tag, const void *keyp, size_t keylen)
 Return database iterator. More...
 
int rpmdbRemove (rpmdb db, int rid, uint32_t hdrNum, rpmts ts)
 Remove package header from rpm database and indices. More...
 
int rpmdbAdd (rpmdb db, int iid, Header h, rpmts ts)
 Add package header to rpm database and indices. More...
 

Variables

int _rpmdb_debug = 0
 
int _rpmmi_debug = 0
 
static struct _dbiVec * mydbvecs []
 
static union _dbswap _endian = { 0x11223344 }
 
static rpmdb rpmdbRock
 
static rpmmi rpmmiRock
 
static const char l10n_sql_init []
 
static const char l10n_sql_qfmt [] =
 
rpmioPool _rpmdbPool
 
rpmioPool _rpmmiPool
 
static int _rpmmi_usermem = 1
 

Macro Definition Documentation

#define _DB_ERRPFX   "rpmdb"

Definition at line 1000 of file rpmdb.c.

Referenced by rpmdbNew().

#define _DB_FLAGS   0

Definition at line 995 of file rpmdb.c.

Referenced by rpmdbNew().

#define _DB_HOME   "%{?_dbpath}"

Definition at line 994 of file rpmdb.c.

Referenced by rpmdbNew().

#define _DB_MAJOR   3

Definition at line 999 of file rpmdb.c.

Referenced by rpmdbNew(), and rpmdbOpen().

#define _DB_MODE   0

Definition at line 996 of file rpmdb.c.

Referenced by rpmdbNew().

#define _DB_PERMS   0644

Definition at line 997 of file rpmdb.c.

Referenced by rpmdbNew().

#define _DB_ROOT   "/"

Definition at line 993 of file rpmdb.c.

Referenced by rpmdbNew().

#define _DBI_FLAGS   0

Definition at line 66 of file rpmdb.c.

#define _DBI_MAJOR   -1

Definition at line 68 of file rpmdb.c.

#define _DBI_PERMS   0644

Definition at line 67 of file rpmdb.c.

#define _MIRE_INTERNAL

Definition at line 14 of file rpmdb.c.

#define _RPMBF_INTERNAL

Definition at line 20 of file rpmdb.c.

#define _RPMDB_INTERNAL

Definition at line 27 of file rpmdb.c.

#define _RPMTAG_INTERNAL

Definition at line 24 of file rpmdb.c.

#define DB1vec   NULL

Definition at line 180 of file rpmdb.c.

#define DB2vec   NULL

Definition at line 181 of file rpmdb.c.

#define DB3vec   NULL

Definition at line 191 of file rpmdb.c.

#define SQLITEvec   NULL

Definition at line 202 of file rpmdb.c.

#define UINT32_T   rpmuint32_t

Definition at line 39 of file rpmdb.c.

Referenced by dbiMireKeys(), miFreeHeader(), rpmdbAdd(), rpmdbCount(), rpmdbRemove(), rpmmiCount(), and rpmmiNext().

Typedef Documentation

typedef struct _setSwap_s * setSwap

Function Documentation

static uint32_t _hton_ui ( uint32_t  ui)
inlinestatic

Definition at line 335 of file rpmdb.c.

References _ntoh_ui().

Referenced by rpmdbAdd(), rpmdbRemove(), rpmmiInit(), rpmmiNext(), and rpmmiPrune().

static uint64_t _hton_ul ( uint64_t  ul)
inlinestatic

Definition at line 317 of file rpmdb.c.

References _ntoh_ul().

static uint16_t _hton_us ( uint16_t  us)
inlinestatic

Definition at line 352 of file rpmdb.c.

References _ntoh_us().

Referenced by rpmmiInit().

static uint32_t _ntoh_ui ( uint32_t  ui)
inlinestatic

Definition at line 323 of file rpmdb.c.

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

Referenced by _hton_ui(), dbiMireKeys(), miFreeHeader(), rpmmiInstance(), and rpmmiNext().

static uint64_t _ntoh_ul ( uint64_t  ul)
inlinestatic

Definition at line 303 of file rpmdb.c.

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

Referenced by _hton_ul().

static uint16_t _ntoh_us ( uint16_t  us)
inlinestatic

Definition at line 341 of file rpmdb.c.

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

Referenced by _hton_us().

static const char* _str2PCREpat ( const char *  _pre,
const char *  s,
const char *  _post 
)
static

Definition at line 1278 of file rpmdb.c.

References se, stpcpy(), t, te, and xmalloc.

Referenced by dbiFindMatches().

static char* bin2hex ( const void data,
size_t  size 
)
static

Convert binary blob to printable hex string.

Parameters
databinary data
sizesize of data in bytes
Returns
malloc'd hex string

Definition at line 2018 of file rpmdb.c.

References i, s, t, unsigned, val, and xmalloc.

Referenced by mireSkip().

static int blockSignals ( rpmdb  db,
sigset_t *  oldMask 
)
static

Block all signals, returning previous signal mask.

Parameters
dbrpm database
Return values
*oldMaskprevious sigset
Returns
0 on success

Definition at line 541 of file rpmdb.c.

References newMask, NULL, and void.

Referenced by miFreeHeader(), rpmdbAdd(), and rpmdbRemove().

static int checkfd ( const char *  devnull,
int  fdno,
int  flags 
)
inlinestatic

Definition at line 212 of file rpmdb.c.

References errno, fdno, and ret.

Referenced by dbiOpen().

static int dbiAppendSet ( dbiIndexSet  set,
const void recs,
int  nrecs,
size_t  recsize,
int  sortset 
)
static

Append element(s) to set of index database items.

Parameters
setset of index database items
recsarray of items to append to set
nrecsnumber of items
recsizesize of an array item
sortsetshould resulting set be sorted?
Returns
0 success, 1 failure (bad args)

Definition at line 382 of file rpmdb.c.

References hdrNumCmp(), memset(), NULL, qsort(), and xrealloc.

Referenced by dbiMireKeys(), rpmmiGrow(), and rpmmiGrowBasename().

static rpmRC dbiFindMatches ( dbiIndex  dbi,
const char *  pat,
dbiIndexSet matches 
)
static

Attempt partial matches on name[-version[-release]] strings.

Parameters
dbiindex database handle (always RPMTAG_NVRA)
patpattern to match against secondary keys
Return values
matchesset of header instances that match
Returns
RPMRC_OK on match, RPMRC_NOMATCH or RPMRC_FAIL

Definition at line 1532 of file rpmdb.c.

References _, _free(), _str2PCREpat(), DB_NOTFOUND, dbiFreeIndexSet(), dbiMireKeys(), exit, Glob_pattern_p(), mode, ns, NULL, rc, ret, rpmlog(), RPMLOG_ERR, RPMMIRE_GLOB, RPMMIRE_PCRE, RPMMIRE_STRCMP, RPMRC_FAIL, RPMRC_NOTFOUND, RPMRC_OK, RPMTAG_FILEPATHS, RPMTAG_NVRA, s, tag, tagName(), xstrdup(), and xx.

Referenced by rpmmiInit().

dbiIndexSet dbiFreeIndexSet ( dbiIndexSet  set)

Definition at line 428 of file rpmdb.c.

References _free().

Referenced by dbiFindMatches(), dbiMireKeys(), rpmmiFini(), rpmmiGrowBasename(), and rpmmiInit().

uint32_t dbiIndexRecordFileNumber ( dbiIndexSet  set,
unsigned int  recno 
)

Definition at line 423 of file rpmdb.c.

Referenced by rpmmiNext().

uint32_t dbiIndexRecordOffset ( dbiIndexSet  set,
unsigned int  recno 
)

Definition at line 418 of file rpmdb.c.

Referenced by rpmmiNext().

unsigned int dbiIndexSetCount ( dbiIndexSet  set)

Definition at line 413 of file rpmdb.c.

static int dbiMireKeys ( rpmdb  db,
rpmTag  tag,
rpmMireMode  mode,
const char *  pat,
dbiIndexSet matches,
const char ***  argvp 
)
static

Retrieve prinary/secondary keys for a pattern match.

Todo:
Move to Berkeley DB db3.c when dbiIndexSet is eliminated.
Parameters
dbrpm database
tagrpm tag
modetype of pattern match
patpattern to match (NULL iterates all keys).
Return values
*matchesarray or primary keys that match (or NULL)
*argvparray of secondary keys that match (or NULL)

Definition at line 1316 of file rpmdb.c.

References _, _free(), _ntoh_ui(), argvAdd(), argvAppend(), argvFree(), assert(), av, b, be, __db_dbt::data, DB_CURRENT, DB_DBT_PARTIAL, DB_NEXT, DB_NEXT_DUP, DB_NOTFOUND, DB_SET, DB_SET_RANGE, dbi, dbiAppendSet(), dbiFreeIndexSet(), dbiOpen(), __db_dbt::dlen, __db_dbt::doff, exit, __db_dbt::flags, fprintf(), hdrNum, if(), k, memset(), mireFree(), mireNew(), mireRegcomp(), mireRegexec(), nb, ns, NULL, p, rc, ret, rpmlog(), RPMLOG_ERR, RPMMIRE_GLOB, RPMMIRE_PCRE, RPMMIRE_REGEX, RPMMIRE_STRCMP, s, __db_dbt::size, stemEnd(), tagName(), UINT32_T, void, xcalloc(), xmalloc, and xx.

Referenced by dbiFindMatches(), rpmdbMireApply(), and rpmmiGrowBasename().

dbiIndex dbiOpen ( rpmdb  db,
rpmTag  tag,
unsigned int  flags 
)
void* dbiStatsAccumulator ( dbiIndex  dbi,
int  opx 
)

Definition at line 1603 of file rpmdb.c.

References NULL.

static void dbiTagsInit ( tagStore_t dbiTagsP,
size_t *  dbiNTagsP 
)
static

Initialize database (index, tag) tuple from configuration.

Definition at line 94 of file rpmdb.c.

References _free(), fprintf(), NULL, o, oe, RPMDBI_PACKAGES, rpmExpand(), tag, tagStoreFree(), tagValue(), xcalloc(), xisspace(), xrealloc, and xstrdup().

Referenced by rpmdbNew().

static size_t dbiTagToDbix ( rpmdb  db,
rpmTag  tag 
)
static

Return dbi index used for rpm tag.

Parameters
dbrpm database
tagrpm tag
Returns
dbi index, 0xffffffff on error

Definition at line 76 of file rpmdb.c.

References NULL.

Referenced by dbiOpen().

static int hdrNumCmp ( const void one,
const void two 
)
static

Definition at line 365 of file rpmdb.c.

References b.

Referenced by dbiAppendSet(), and rpmmiSort().

static int miFreeHeader ( rpmmi  mi,
dbiIndex  dbi 
)
static

Rewrite a header into packages (if necessary) and free the header.

Note: this is called from a markReplacedFiles iteration, and must preserve the "join key" (i.e. offset) for the header.

Parameters
midatabase iterator
dbiindex database handle
Returns
0 on success

Definition at line 1629 of file rpmdb.c.

References _, _free(), _ntoh_ui(), blockSignals(), __db_dbt::data, DB_KEYLAST, headerFree, headerUnload(), k, len, rpmmi_s::mi_dbc, rpmmi_s::mi_h, rpmmi_s::mi_modified, rpmmi_s::mi_prevoffset, NULL, rc, rpmlog(), RPMLOG_ERR, __db_dbt::size, tagName(), UINT32_T, unblockSignals(), void, and xx.

Referenced by rpmmiFini(), and rpmmiNext().

static int mireCmp ( const void a,
const void b 
)
static

Compare iterator selectors by rpm tag (qsort/bsearch).

Parameters
a1st iterator selector
b2nd iterator selector
Returns
result of comparison

Definition at line 1797 of file rpmdb.c.

Referenced by rpmmiAddPattern().

static char* mireDup ( rpmTag  tag,
rpmMireMode modep,
const char *  pattern 
)
static

Copy pattern, escaping for appropriate mode.

Parameters
tagrpm tag
Return values
modeptype of pattern match
Parameters
patternpattern to duplicate
Returns
duplicated pattern

Definition at line 1813 of file rpmdb.c.

References c, int, nb, RPMMIRE_DEFAULT, RPMMIRE_GLOB, RPMMIRE_REGEX, RPMMIRE_STRCMP, RPMTAG_BASENAMES, RPMTAG_DIRNAMES, RPMTAG_FILEPATHS, s, t, xmalloc, and xstrdup().

Referenced by rpmmiAddPattern().

static int mireSkip ( const rpmmi  mi)
static
static unsigned char nibble ( char  c)
inlinestatic

Convert hex to binary nibble.

Parameters
chex character
Returns
binary nibble

Definition at line 1999 of file rpmdb.c.

References int.

static const char* queryHeader ( Header  h,
const char *  qfmt 
)
inlinestatic

Return header query string.

Warning
Only compound header extensions are available here.
Parameters
hheader
qfmtheader sprintf format
Returns
header query string

Definition at line 579 of file rpmdb.c.

References _, headerCompoundFormats, headerSprintf(), NULL, rpmlog(), and RPMLOG_ERR.

Referenced by rpmdbExportHR_MIB(), and rpmdbExportL10N_SQL().

int rpmdbBlockDBI ( rpmdb  db,
int  tag 
)

Block access to a single database index.

Parameters
dbrpm database
tagrpm tag (negative to block)
Returns
0 on success

Definition at line 821 of file rpmdb.c.

References NULL.

Referenced by rpmgiNext().

int rpmdbCloseDBI ( rpmdb  db,
int  tag 
)

Close a single database index.

Parameters
dbrpm database
tagrpm tag
Returns
0 on success

Definition at line 839 of file rpmdb.c.

References NULL, rc, and xx.

Referenced by _rpmtsCheck().

static int rpmdbExportHR_MIB ( rpmdb  db,
Header  h,
int  adding 
)
static

Write added/removed header info into %{_hrmib_path}.

Parameters
dbrpm database
hheader
addingadding an rpmdb header?
Returns
0 on success

Definition at line 601 of file rpmdb.c.

References _free(), alloca(), errno, exit, Fclose(), fd, fn, Fopen(), headerGet(), memset(), NULL, _HE_s::p, rpmDataType_u::ptr, queryHeader(), rc, rpmGetPath(), rpmioMkpath(), rpmlog(), RPMLOG_DEBUG, RPMTAG_INSTALLTID, _HE_s::tag, rpmDataType_u::ui32p, Unlink(), Utime(), xstrdup(), and xx.

Referenced by rpmdbExportInfo().

static int rpmdbExportInfo ( rpmdb  db,
Header  h,
int  adding 
)
static

Write added/removed header info.

Parameters
dbrpm database
hheader
addingadding an rpmdb header?
Returns
0 on success

Definition at line 748 of file rpmdb.c.

References rc, rpmdbExportHR_MIB(), rpmdbExportL10N_SQL(), void, and xx.

Referenced by rpmdbNew().

static int rpmdbExportL10N_SQL ( rpmdb  db,
Header  h,
int  adding 
)
static

Update added header info into %{__l10ndir} sqlite3 database.

Parameters
dbrpm database
hheader
addingadding an rpmdb header?
Returns
0 on success

Definition at line 682 of file rpmdb.c.

References _free(), assert(), errno, exit, fn, NULL, queryHeader(), rc, rpmExpand(), rpmGetPath(), rpmioMkpath(), t, and xstrdup().

Referenced by rpmdbExportInfo().

static rpmdb rpmdbGetPool ( rpmioPool  pool)
static

Definition at line 771 of file rpmdb.c.

References _rpmdbPool, memset(), NULL, rpmioGetPool(), and rpmioNewPool().

Referenced by rpmdbNew().

rpmdb rpmdbNew ( const char *  root,
const char *  home,
int  mode,
mode_t  perms,
int  flags 
)
static int rpmdbOpenDatabase ( const char *  prefix,
const char *  dbpath,
int  _dbapi,
rpmdb dbp,
int  mode,
mode_t  perms,
int  flags 
)
static
static const char* rpmdbURIPath ( const char *  uri)
static

Return macro expanded absolute path to rpmdb.

Parameters
uridesired path
Returns
macro expanded absolute path

Definition at line 940 of file rpmdb.c.

References _free(), argvFree(), argvSplit(), assert(), av, fn, NULL, PATH_MAX, Realpath(), rpmGetPath(), s, stpncpy(), t, URL_IS_DASH, URL_IS_FTP, URL_IS_HKP, URL_IS_HTTP, URL_IS_HTTPS, URL_IS_MONGO, URL_IS_PATH, URL_IS_UNKNOWN, urlPath(), xstrdup(), and xx.

Referenced by rpmdbNew().

static void rpmmiFini ( void _mi)
static
static int rpmmiGet ( dbiIndex  dbi,
DBC dbcursor,
DBT kp,
DBT pk,
DBT vp,
unsigned int  flags 
)
static
static rpmmi rpmmiGetPool ( rpmioPool  pool)
static

Definition at line 1727 of file rpmdb.c.

References rpmmi_s::_item, _rpmmiPool, memset(), mi, NULL, rpmioGetPool(), rpmioNewPool(), and rpmmiFini().

Referenced by rpmmiInit().

static const char* stemEnd ( const char *  s)
static

Definition at line 1244 of file rpmdb.c.

References c, exit, and s.

Referenced by dbiMireKeys().

static int unblockSignals ( rpmdb  db,
sigset_t *  oldMask 
)
static

Restore signal mask.

Parameters
dbrpm database
oldMaskprevious sigset
Returns
0 on success

Definition at line 564 of file rpmdb.c.

References NULL, rpmdbCheckSignals(), and void.

Referenced by miFreeHeader(), rpmdbAdd(), and rpmdbRemove().

Variable Documentation

union _dbswap _endian = { 0x11223344 }
static

Definition at line 301 of file rpmdb.c.

int _rpmdb_debug = 0

Definition at line 61 of file rpmdb.c.

rpmioPool _rpmdbPool

Definition at line 769 of file rpmdb.c.

Referenced by rpmdbGetPool().

int _rpmmi_debug = 0

Definition at line 64 of file rpmdb.c.

int _rpmmi_usermem = 1
static

Definition at line 2190 of file rpmdb.c.

Referenced by rpmmiGet(), and rpmmiNext().

rpmioPool _rpmmiPool

Definition at line 1725 of file rpmdb.c.

Referenced by rpmmiGetPool().

const char l10n_sql_init[]
static
Initial value:
= "\
CREATE TABLE IF NOT EXISTS l10n (\n\
k TEXT UNIQUE PRIMARY KEY NOT NULL,\n\
v TEXT NOT NULL\n\
);\n\
"

Definition at line 665 of file rpmdb.c.

const char l10n_sql_qfmt[] =
static

Definition at line 671 of file rpmdb.c.

struct _dbiVec* mydbvecs[]
static
Initial value:
= {
NULL , NULL , NULL , NULL , NULL , NULL
}
return NULL
Definition: poptALL.c:613

Definition at line 207 of file rpmdb.c.

rpmdb rpmdbRock
static

Definition at line 471 of file rpmdb.c.

Referenced by rpmdbClose(), and rpmdbOpenDatabase().

rpmmi rpmmiRock
static

Definition at line 474 of file rpmdb.c.

Referenced by rpmmiFini(), and rpmmiInit().