rpmdb.h
Go to the documentation of this file.
#ifndef H_RPMDB
#define H_RPMDB
/*@-bounds@*/
#include <assert.h>
#include <rpmtypes.h>
#include <mire.h>
#if defined(_RPMDB_INTERNAL)
#if defined(WITH_DB)
#include "db.h"
#else
#include "db_emu.h"
#endif
#endif
#if defined(_RPMDB_INTERNAL)
#define DBT_INIT /*@-fullinitblock@*/ {0} /*@-fullinitblock@*/ /* -Wno-missing-field-initializers */
#endif
/*@-exportlocal@*/
/*@unchecked@*/
extern int _rpmdb_debug;
/*@=exportlocal@*/
#ifdef NOTYET
typedef /*@abstract@*/ /*@refcounted@*/ struct rpmdb_s * rpmdb;
typedef /*@abstract@*/ struct rpmmi_s * rpmmi;
#endif
typedef /*@abstract@*/ struct _dbiIndexItem * dbiIndexItem;
typedef /*@abstract@*/ struct _dbiIndexSet * dbiIndexSet;
typedef /*@abstract@*/ struct _dbiIndex * dbiIndex;
#if defined(_RPMDB_INTERNAL)
#include <rpmio.h>
#include <rpmsw.h>
#if !defined(SWIG) /* XXX inline dbiFoo() need */
struct _dbiIndexItem {
rpmuint32_t hdrNum;
rpmuint32_t tagNum;
rpmuint32_t fpNum;
};
struct _dbiIndexSet {
/*@owned@*/ struct _dbiIndexItem * recs;
int count;
};
struct _dbiVec {
int dbv_major;
int dbv_minor;
int dbv_patch;
int (*open) (rpmdb rpmdb, rpmTag tag, /*@out@*/ dbiIndex * dbip)
/*@globals fileSystem @*/
/*@modifies *dbip, fileSystem @*/;
int (*close) (/*@only@*/ dbiIndex dbi, unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, fileSystem @*/;
int (*sync) (dbiIndex dbi, unsigned int flags)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
int (*associate) (dbiIndex dbi, dbiIndex dbisecondary,
int (*callback) (DB *, const DBT *, const DBT *, DBT *),
unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, fileSystem @*/;
int (*join) (dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp,
unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, *dbcp, fileSystem @*/;
int (*copen) (dbiIndex dbi, /*@null@*/ DB_TXN * txnid,
/*@out@*/ DBC ** dbcp, unsigned int dbiflags)
/*@globals fileSystem @*/
/*@modifies dbi, *txnid, *dbcp, fileSystem @*/;
int (*cclose) (dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, *dbcursor, fileSystem @*/;
int (*cdup) (dbiIndex dbi, DBC * dbcursor, /*@out@*/ DBC ** dbcp,
unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, *dbcp, fileSystem @*/;
int (*cdel) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
unsigned int flags)
/*@globals fileSystem @*/
/*@modifies *dbcursor, fileSystem @*/;
int (*cget) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
unsigned int flags)
/*@globals fileSystem @*/
/*@modifies *dbcursor, *key, *data, fileSystem @*/;
int (*cpget) (dbiIndex dbi, /*@null@*/ DBC * dbcursor,
DBT * key, DBT * pkey, DBT * data, unsigned int flags)
/*@globals fileSystem @*/
/*@modifies *dbcursor, *key, *pkey, *data, fileSystem @*/;
int (*cput) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
unsigned int flags)
/*@globals fileSystem @*/
/*@modifies *dbcursor, fileSystem @*/;
int (*ccount) (dbiIndex dbi, DBC * dbcursor,
/*@out@*/ unsigned int * countp,
unsigned int flags)
/*@globals fileSystem @*/
/*@modifies *dbcursor, fileSystem @*/;
int (*byteswapped) (dbiIndex dbi)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
int (*stat) (dbiIndex dbi, unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, fileSystem @*/;
};
struct _dbiIndex {
/*@relnull@*/
const char * dbi_root;
/*@null@*/
const char * dbi_home;
/*@relnull@*/
const char * dbi_file;
/*@relnull@*/
const char * dbi_subfile;
/*@null@*/
const char * dbi_tmpdir;
int dbi_ecflags;
int dbi_cflags;
int dbi_oeflags;
int dbi_eflags;
int dbi_oflags;
int dbi_tflags;
int dbi_type;
unsigned dbi_mode;
int dbi_perms;
long dbi_shmkey;
int dbi_api;
int dbi_verify_on_close;
int dbi_use_dbenv;
int dbi_permit_dups;
int dbi_no_fsync;
int dbi_no_dbsync;
int dbi_lockdbfd;
int dbi_temporary;
int dbi_noload;
int dbi_debug;
int dbi_byteswapped;
/*@null@*/
char * dbi_host;
unsigned long dbi_cl_timeout;
unsigned long dbi_sv_timeout;
/* dbenv parameters */
int dbi_lorder;
/*@unused@*/
/* XXX db-4.3.14 adds dbenv as 1st arg. */
void (*db_errcall) (void * dbenv, const char *db_errpfx, char *buffer)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/*@unused@*/ /*@shared@*/
FILE * dbi_errfile;
const char * dbi_errpfx;
int dbi_verbose;
int dbi_region_init;
unsigned int dbi_thread_count;
/* locking sub-system parameters */
unsigned int dbi_lk_max_lockers;
unsigned int dbi_lk_max_locks;
unsigned int dbi_lk_max_objects;
unsigned int dbi_lk_detect;
/*@unused@*/
int dbi_lk_nmodes;
/*@unused@*/
unsigned char * dbi_lk_conflicts;
/* logging sub-system parameters */
unsigned int dbi_lg_bsize;
/*@unused@*/
const char * dbi_lg_dir;
/*@unused@*/
unsigned int dbi_lg_filemode;
unsigned int dbi_lg_max;
unsigned int dbi_lg_regionmax;
/* mpool sub-system parameters */
int dbi_mmapsize;
int dbi_cachesize;
/* mutex sub-system parameters */
unsigned int dbi_mutex_align;
unsigned int dbi_mutex_increment;
unsigned int dbi_mutex_max;
unsigned int dbi_mutex_tas_spins;
/* replication sub-system parameters */
/* sequences sub-system parameters */
unsigned int dbi_seq_cachesize;
unsigned int dbi_seq_flags;
#if 0 /* needs signed 64 bit type */
int64_t dbi_seq_min;
int64_t dbi_seq_max;
#endif
/* transaction sub-system parameters */
unsigned int dbi_tx_max;
#if 0
int (*dbi_tx_recover) (DB_ENV *dbenv, DBT *log_rec,
DB_LSN *lsnp, int redo, void *info)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
#endif
/* dbinfo parameters */
int dbi_pagesize;
/*@unused@*/ /*@null@*/
void * (*dbi_malloc) (size_t nbytes)
/*@*/;
/* hash access parameters */
unsigned int dbi_h_ffactor;
unsigned int (*dbi_h_hash_fcn) (DB *, const void *bytes,
unsigned int length)
/*@*/;
unsigned int dbi_h_nelem;
unsigned int dbi_h_flags;
int (*dbi_h_dup_compare_fcn) (DB *, const DBT *, const DBT *)
/*@*/;
/* btree access parameters */
int dbi_bt_flags;
int dbi_bt_minkey;
int (*dbi_bt_compare_fcn) (DB *, const DBT *, const DBT *)
/*@*/;
int (*dbi_bt_dup_compare_fcn) (DB *, const DBT *, const DBT *)
/*@*/;
size_t (*dbi_bt_prefix_fcn) (DB *, const DBT *, const DBT *)
/*@*/;
/* recno access parameters */
int dbi_re_flags;
int dbi_re_delim;
unsigned int dbi_re_len;
int dbi_re_pad;
const char * dbi_re_source;
/* queue access parameters */
unsigned int dbi_q_extentsize;
/*@refcounted@*/
rpmdb dbi_rpmdb;
rpmTag dbi_rpmtag;
size_t dbi_jlen;
/*@only@*//*@relnull@*/
DB * dbi_db;
/*@only@*//*@null@*/
DB_TXN * dbi_txnid;
/*@only@*//*@null@*/
void * dbi_stats;
/*@observer@*/
const struct _dbiVec * dbi_vec;
};
#endif /* !defined(SWIG) */
struct rpmdb_s {
struct rpmioItem_s _item;
/*@owned@*/ /*@relnull@*/
const char * db_root;
/*@owned@*/
const char * db_home;
int db_flags;
int db_mode;
int db_perms;
int db_api;
/*@owned@*/
const char * db_errpfx;
int db_remove_env;
int db_filter_dups;
int db_verifying;
int db_chrootDone;
void (*db_errcall) (const char * db_errpfx, char * buffer)
/*@*/;
/*@shared@*/
FILE * db_errfile;
/*@only@*/
void * (*db_malloc) (size_t nbytes)
/*@*/;
/*@only@*/
void * (*db_realloc) (/*@only@*//*@null@*/ void * ptr, size_t nbytes)
/*@*/;
void (*db_free) (/*@only@*/ void * ptr)
/*@modifies *ptr @*/;
int (*db_export) (rpmdb db, Header h, int adding);
/*@only@*/ /*@null@*/
unsigned char * db_bits;
int db_nbits;
rpmdb db_next;
int db_opens;
/*@only@*/ /*@null@*/
void * db_dbenv;
tagStore_t db_tags;
size_t db_ndbi;
/*@only@*/ /*@null@*/
dbiIndex * _dbi;
struct rpmop_s db_getops;
struct rpmop_s db_putops;
struct rpmop_s db_delops;
#if defined(__LCLINT__)
/*@refs@*/
int nrefs;
#endif
};
#endif /* defined(_RPMDB_INTERNAL) */
/* for RPM's internal use only */
enum rpmdbFlags {
RPMDB_FLAG_JUSTCHECK = (1 << 0),
RPMDB_FLAG_MINIMAL = (1 << 1),
/*@-enummemuse@*/
RPMDB_FLAG_CHROOT = (1 << 2)
/*@=enummemuse@*/
};
#ifdef __cplusplus
extern "C" {
#endif
#if defined(_RPMDB_INTERNAL)
/*@-exportlocal@*/
#if defined(WITH_DB) || defined(WITH_SQLITE)
/*@unused@*/ /*@only@*/ /*@null@*/
dbiIndex db3New(rpmdb rpmdb, rpmTag tag)
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies rpmGlobalMacroContext, internalState @*/;
/*@null@*/
dbiIndex db3Free( /*@only@*/ /*@null@*/ dbiIndex dbi)
/*@*/;
/*@-redecl@*/
/*@exposed@*/
extern const char * prDbiOpenFlags(int dbflags, int print_dbenv_flags)
/*@*/;
/*@=redecl@*/
#endif
/*@only@*/ /*@null@*/ dbiIndex dbiOpen(/*@null@*/ rpmdb db, rpmTag tag,
unsigned int flags)
/*@globals rpmGlobalMacroContext, errno, h_errno, internalState @*/
/*@modifies db, rpmGlobalMacroContext, errno, internalState @*/;
void * dbiStatsAccumulator(dbiIndex dbi, int opx)
/*@*/;
#if !defined(SWIG)
/*@-globuse -mustmod @*/ /* FIX: vector annotations */
/*@unused@*/ static inline
int dbiCopen(dbiIndex dbi, /*@null@*/ DB_TXN * txnid,
/*@out@*/ DBC ** dbcp, unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, *dbcp, fileSystem @*/
{
return (*dbi->dbi_vec->copen) (dbi, txnid, dbcp, flags);
}
/*@unused@*/ static inline
int dbiCclose(dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, *dbcursor, fileSystem @*/
{
return (*dbi->dbi_vec->cclose) (dbi, dbcursor, flags);
}
/*@unused@*/ static inline
int dbiCdup(dbiIndex dbi, DBC * dbcursor, /*@out@*/ DBC ** dbcp,
unsigned int flags)
/*@modifies dbi, *dbcp @*/
{
return (*dbi->dbi_vec->cdup) (dbi, dbcursor, dbcp, flags);
}
/*@unused@*/ static inline
int dbiDel(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
unsigned int flags)
/*@globals fileSystem, internalState @*/
/*@modifies dbi, *dbcursor, fileSystem, internalState @*/
{
rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 16); /* RPMTS_OP_DBDEL */
int rc;
assert(key->data != NULL && key->size > 0);
(void) rpmswEnter(sw, 0);
rc = (dbi->dbi_vec->cdel) (dbi, dbcursor, key, data, flags);
(void) rpmswExit(sw, data->size);
return rc;
}
/*@unused@*/ static inline
int dbiGet(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
unsigned int flags)
/*@globals fileSystem, internalState @*/
/*@modifies dbi, *dbcursor, *key, *data, fileSystem, internalState @*/
{
rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 14); /* RPMTS_OP_DBGET */
int rc;
assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0));
(void) rpmswEnter(sw, 0);
rc = (dbi->dbi_vec->cget) (dbi, dbcursor, key, data, flags);
(void) rpmswExit(sw, data->size);
return rc;
}
/*@unused@*/ static inline
int dbiPget(dbiIndex dbi, /*@null@*/ DBC * dbcursor,
DBT * key, DBT * pkey, DBT * data, unsigned int flags)
/*@globals fileSystem, internalState @*/
/*@modifies dbi, *dbcursor, *key, *pkey, *data, fileSystem, internalState @*/
{
rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 14); /* RPMTS_OP_DBGET */
int rc;
assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0));
(void) rpmswEnter(sw, 0);
rc = (dbi->dbi_vec->cpget) (dbi, dbcursor, key, pkey, data, flags);
(void) rpmswExit(sw, data->size);
return rc;
}
/*@unused@*/ static inline
int dbiPut(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
unsigned int flags)
/*@globals fileSystem, internalState @*/
/*@modifies dbi, *dbcursor, *key, fileSystem, internalState @*/
{
rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 15); /* RPMTS_OP_DBPUT */
int rc;
assert(key->data != NULL && key->size > 0 && data->data != NULL && data->size > 0);
(void) rpmswEnter(sw, 0);
rc = (dbi->dbi_vec->cput) (dbi, dbcursor, key, data, flags);
(void) rpmswExit(sw, data->size);
return rc;
}
/*@unused@*/ static inline
int dbiCount(dbiIndex dbi, DBC * dbcursor, /*@out@*/ unsigned int * countp,
unsigned int flags)
/*@globals fileSystem @*/
/*@modifies *dbcursor, fileSystem @*/
{
return (*dbi->dbi_vec->ccount) (dbi, dbcursor, countp, flags);
}
/*@unused@*/ static inline
int dbiVerify(/*@only@*/ dbiIndex dbi, unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, fileSystem @*/
{
dbi->dbi_verify_on_close = 1;
return (*dbi->dbi_vec->close) (dbi, flags);
}
/*@unused@*/ static inline
int dbiClose(/*@only@*/ dbiIndex dbi, unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, fileSystem @*/
{
return (*dbi->dbi_vec->close) (dbi, flags);
}
/*@unused@*/ static inline
int dbiSync (dbiIndex dbi, unsigned int flags)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/
{
return (*dbi->dbi_vec->sync) (dbi, flags);
}
/*@unused@*/ static inline
int dbiAssociate(dbiIndex dbi, dbiIndex dbisecondary,
int (*callback) (DB *, const DBT *, const DBT *, DBT *),
unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, fileSystem @*/
{
return (*dbi->dbi_vec->associate) (dbi, dbisecondary, callback, flags);
}
/*@unused@*/ static inline
int dbiJoin(dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp,
unsigned int flags)
/*@globals fileSystem @*/
/*@modifies dbi, *dbcp, fileSystem @*/
{
return (*dbi->dbi_vec->join) (dbi, curslist, dbcp, flags);
}
/*@unused@*/ static inline
int dbiByteSwapped(dbiIndex dbi)
/*@modifies dbi @*/
{
if (dbi->dbi_byteswapped == -1)
dbi->dbi_byteswapped = (*dbi->dbi_vec->byteswapped) (dbi);
return dbi->dbi_byteswapped;
}
/*@unused@*/ static inline
int dbiStat(dbiIndex dbi, unsigned int flags)
/*@modifies dbi @*/
{
return (*dbi->dbi_vec->stat) (dbi, flags);
}
/*@unused@*/ static inline /*@observer@*/ /*@null@*/
DB_TXN * dbiTxnid(dbiIndex dbi)
/*@*/
{
return dbi->dbi_txnid;
}
/*@=globuse =mustmod @*/
#endif /* !defined(SWIG) */
/*@=exportlocal@*/
/*@null@*/
dbiIndexSet dbiFreeIndexSet(/*@only@*/ /*@null@*/ dbiIndexSet set)
/*@modifies set @*/;
unsigned int dbiIndexSetCount(dbiIndexSet set)
/*@*/;
unsigned int dbiIndexRecordOffset(dbiIndexSet set, int recno)
/*@*/;
unsigned int dbiIndexRecordFileNumber(dbiIndexSet set, int recno)
/*@*/;
#endif /* defined(_RPMDB_INTERNAL) */
/*@unused@*/ /*@null@*/
rpmdb rpmdbUnlink (/*@killref@*/ /*@only@*/ rpmdb db, const char * msg)
/*@modifies db @*/;
#define rpmdbUnlink(_db, _msg) \
((rpmdb)rpmioUnlinkPoolItem((rpmioItem)(_db), _msg, __FILE__, __LINE__))
/*@unused@*/ /*@newref@*/
rpmdb rpmdbLink (rpmdb db, const char * msg)
/*@modifies db @*/;
#define rpmdbLink(_db, _msg) \
((void *)rpmioLinkPoolItem((rpmioItem)(_db), _msg, __FILE__, __LINE__))
/*@only@*/ /*@null@*/
rpmdb rpmdbNew(/*@kept@*/ /*@null@*/ const char * root,
/*@kept@*/ /*@null@*/ const char * home,
int mode, int perms, int flags)
/*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
int rpmdbOpenDatabase(/*@null@*/ const char * prefix,
/*@null@*/ const char * dbpath,
int _dbapi, /*@null@*/ /*@out@*/ rpmdb *dbp,
int mode, int perms, int flags)
/*@globals rpmGlobalMacroContext, h_errno,
fileSystem, internalState @*/
/*@modifies *dbp, rpmGlobalMacroContext,
fileSystem, internalState @*/;
int rpmdbOpen (/*@null@*/ const char * prefix, /*@null@*/ /*@out@*/ rpmdb * dbp,
int mode, int perms)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies *dbp, rpmGlobalMacroContext, fileSystem, internalState @*/;
int rpmdbInit(/*@null@*/ const char * prefix, int perms)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
int rpmdbVerifyAllDBI(rpmdb db)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
int rpmdbVerify(/*@null@*/ const char * prefix)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
int rpmdbBlockDBI(/*@null@*/ rpmdb db, int tag)
/*@modifies db @*/;
int rpmdbCloseDBI(/*@null@*/ rpmdb db, int tag)
/*@globals fileSystem @*/
/*@modifies db, fileSystem @*/;
int rpmdbClose (/*@killref@*/ /*@only@*/ /*@null@*/ rpmdb db)
/*@globals fileSystem @*/
/*@modifies db, fileSystem @*/;
int rpmdbSync (/*@null@*/ rpmdb db)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/;
/*@-exportlocal@*/
int rpmdbOpenAll (/*@null@*/ rpmdb db)
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies db, rpmGlobalMacroContext, internalState @*/;
/*@=exportlocal@*/
int rpmdbCount(/*@null@*/ rpmdb db, rpmTag tag,
const void * keyp, size_t keylen)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
int rpmdbCountPackages(/*@null@*/ rpmdb db, const char * name)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
unsigned int rpmmiInstance(/*@null@*/ rpmmi mi)
/*@*/;
unsigned int rpmmiFilenum(rpmmi mi)
/*@*/;
int rpmmiCount(/*@null@*/ rpmmi mi)
/*@*/;
int rpmmiGrow(/*@null@*/ rpmmi mi,
/*@null@*/ const int * hdrNums, int nHdrNums)
/*@modifies mi @*/;
int rpmmiPrune(/*@null@*/ rpmmi mi,
/*@null@*/ int * hdrNums, int nHdrNums, int sorted)
/*@modifies mi, hdrNums @*/;
int rpmmiAddPattern(/*@null@*/ rpmmi mi, rpmTag tag,
rpmMireMode mode, /*@null@*/ const char * pattern)
/*@globals rpmGlobalMacroContext, h_errno, internalState @*/
/*@modifies mi, mode, rpmGlobalMacroContext, internalState @*/;
int rpmmiSetRewrite(/*@null@*/ rpmmi mi, int rewrite)
/*@modifies mi @*/;
int rpmmiSetModified(/*@null@*/ rpmmi mi, int modified)
/*@modifies mi @*/;
int rpmmiSetHdrChk(/*@null@*/ rpmmi mi, /*@null@*/ rpmts ts)
/*@modifies mi @*/;
/*@only@*/ /*@null@*/
rpmmi rpmmiInit(/*@null@*/ rpmdb db, rpmTag tag,
/*@null@*/ const void * keyp, size_t keylen)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
/*@null@*/
Header rpmmiNext(/*@null@*/ rpmmi mi)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
/*@mayexit@*/
int rpmdbCheckTerminate(int terminate)
/*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
/*@mayexit@*/
int rpmdbCheckSignals(void)
/*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
/*@null@*/
rpmmi rpmmiUnlink(/*@only@*/ /*@null@*/rpmmi mi)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
#define rpmmiUnlink(_mi) \
((rpmmi)rpmioUnlinkPoolItem((rpmioItem)(_mi), __FUNCTION__, __FILE__, __LINE__))
/*@null@*/
rpmmi rpmmiLink(/*@only@*/ /*@null@*/rpmmi mi)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
#define rpmmiLink(_mi) \
((rpmmi)rpmioLinkPoolItem((rpmioItem)(_mi), __FUNCTION__, __FILE__, __LINE__))
/*@null@*/
rpmmi rpmmiFree(/*@only@*/ /*@null@*/rpmmi mi)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
#define rpmmiFree(_mi) \
((rpmmi)rpmioFreePoolItem((rpmioItem)(_mi), __FUNCTION__, __FILE__, __LINE__))
int rpmdbMireApply(rpmdb db, rpmTag tag, rpmMireMode mode, const char * pat,
const char *** argvp)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies db, *argvp,
rpmGlobalMacroContext, fileSystem, internalState @*/;
int rpmdbAdd(/*@null@*/ rpmdb db, int iid, Header h, /*@null@*/ rpmts ts)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies db, h, ts,
rpmGlobalMacroContext, fileSystem, internalState @*/;
int rpmdbRemove(/*@null@*/ rpmdb db, /*@unused@*/ int rid, unsigned int hdrNum,
/*@null@*/ rpmts ts)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies db, ts,
rpmGlobalMacroContext, fileSystem, internalState @*/;
int rpmdbRebuild(/*@null@*/ const char * prefix, /*@null@*/ rpmts ts)
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
/*@unused@*/
int rpm_mergesort(void *base, size_t nmemb, size_t size,
int (*cmp) (const void *, const void *))
/*@globals errno @*/
/*@modifies base, errno @*/;
#ifdef __cplusplus
}
#endif
/*@=bounds@*/
#endif /* H_RPMDB */