Main Page Modules Data Structures File List Data Fields Globals Related Pages

# rpmdb/rpmdb.h

Go to the documentation of this file.

    00001 #ifndef H_RPMDB
    00002 #define H_RPMDB
    00003 /*@-bounds@*/
    00004
    00010 #include <assert.h>
    00011 #include <rpmlib.h>
    00012 #include <db.h>
    00013
    00014 /*@-exportlocal@*/
    00015 /*@unchecked@*/
    00016 extern int _rpmdb_debug;
    00017 /*@=exportlocal@*/
    00018
    00019 #ifdef  NOTYET
    00020
    00023 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmdb_s * rpmdb;
    00024
    00028 typedef /*@abstract@*/ struct _rpmdbMatchIterator * rpmdbMatchIterator;
    00029 #endif
    00030
    00034 typedef enum rpmMireMode_e {
    00035     RPMMIRE_DEFAULT     = 0,
    00036     RPMMIRE_STRCMP      = 1,
    00037     RPMMIRE_REGEX       = 2,
    00038     RPMMIRE_GLOB        = 3
    00039 } rpmMireMode;
    00040
    00043 typedef /*@abstract@*/ struct _dbiIndexItem * dbiIndexItem;
    00044
    00048 typedef /*@abstract@*/ struct _dbiIndexSet * dbiIndexSet;
    00049
    00052 typedef /*@abstract@*/ struct _dbiIndex * dbiIndex;
    00053
    00054 /* this will break if sizeof(int) != 4 */
    00060 struct _dbiIndexItem {
    00061     unsigned int hdrNum;
    00062     unsigned int tagNum;
    00063     unsigned int fpNum;
    00064 };
    00065
    00069 struct _dbiIndexSet {
    00070 /*@owned@*/ struct _dbiIndexItem * recs;
    00071     int count;
    00072 };
    00073
    00077 struct _dbiVec {
    00078     int dbv_major;
    00079     int dbv_minor;
    00080     int dbv_patch;
    00088     int (*open) (rpmdb rpmdb, rpmTag rpmtag, /*@out@*/ dbiIndex * dbip)
    00089         /*@globals fileSystem @*/
    00090         /*@modifies *dbip, fileSystem @*/;
    00091
    00098     int (*close) (/*@only@*/ dbiIndex dbi, unsigned int flags)
    00099         /*@globals fileSystem @*/
    00100         /*@modifies dbi, fileSystem @*/;
    00101
    00108     int (*sync) (dbiIndex dbi, unsigned int flags)
    00109         /*@globals fileSystem @*/
    00110         /*@modifies fileSystem @*/;
    00111
    00120     int (*associate) (dbiIndex dbi, dbiIndex dbisecondary,
    00121                 int (*callback) (DB *, const DBT *, const DBT *, DBT *),
    00122                 unsigned int flags)
    00123         /*@globals fileSystem @*/
    00124         /*@modifies dbi, fileSystem @*/;
    00125
    00134     int (*join) (dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp,
    00135                 unsigned int flags)
    00136         /*@globals fileSystem @*/
    00137         /*@modifies dbi, *dbcp, fileSystem @*/;
    00138
    00147     int (*copen) (dbiIndex dbi, /*@null@*/ DB_TXN * txnid,
    00148                         /*@out@*/ DBC ** dbcp, unsigned int dbiflags)
    00149         /*@globals fileSystem @*/
    00150         /*@modifies dbi, *txnid, *dbcp, fileSystem @*/;
    00151
    00159     int (*cclose) (dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags)
    00160         /*@globals fileSystem @*/
    00161         /*@modifies dbi, *dbcursor, fileSystem @*/;
    00162
    00171     int (*cdup) (dbiIndex dbi, DBC * dbcursor, /*@out@*/ DBC ** dbcp,
    00172                 unsigned int flags)
    00173         /*@globals fileSystem @*/
    00174         /*@modifies dbi, *dbcp, fileSystem @*/;
    00175
    00185     int (*cdel) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
    00186                         unsigned int flags)
    00187         /*@globals fileSystem @*/
    00188         /*@modifies *dbcursor, fileSystem @*/;
    00189
    00199     int (*cget) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
    00200                         unsigned int flags)
    00201         /*@globals fileSystem @*/
    00202         /*@modifies *dbcursor, *key, *data, fileSystem @*/;
    00203
    00214     int (*cpget) (dbiIndex dbi, /*@null@*/ DBC * dbcursor,
    00215                 DBT * key, DBT * pkey, DBT * data, unsigned int flags)
    00216         /*@globals fileSystem @*/
    00217         /*@modifies *dbcursor, *key, *pkey, *data, fileSystem @*/;
    00218
    00228     int (*cput) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
    00229                         unsigned int flags)
    00230         /*@globals fileSystem @*/
    00231         /*@modifies *dbcursor, fileSystem @*/;
    00232
    00241     int (*ccount) (dbiIndex dbi, DBC * dbcursor,
    00242                         /*@out@*/ unsigned int * countp,
    00243                         unsigned int flags)
    00244         /*@globals fileSystem @*/
    00245         /*@modifies *dbcursor, fileSystem @*/;
    00246
    00252     int (*byteswapped) (dbiIndex dbi)
    00253         /*@globals fileSystem @*/
    00254         /*@modifies fileSystem @*/;
    00255
    00262     int (*stat) (dbiIndex dbi, unsigned int flags)
    00263         /*@globals fileSystem @*/
    00264         /*@modifies dbi, fileSystem @*/;
    00265
    00266 };
    00267
    00271 struct _dbiIndex {
    00272 /*@null@*/
    00273     const char * dbi_root;
    00274 /*@null@*/
    00275     const char * dbi_home;
    00276 /*@null@*/
    00277     const char * dbi_file;
    00278 /*@null@*/
    00279     const char * dbi_subfile;
    00280 /*@null@*/
    00281     const char * dbi_tmpdir;
    00283     int dbi_ecflags;
    00284     int dbi_cflags;
    00285     int dbi_oeflags;
    00286     int dbi_eflags;
    00287     int dbi_oflags;
    00288     int dbi_tflags;
    00290     int dbi_type;
    00291     unsigned dbi_mode;
    00292     int dbi_perms;
    00293     long dbi_shmkey;
    00294     int dbi_api;
    00296     int dbi_verify_on_close;
    00297     int dbi_use_dbenv;
    00298     int dbi_permit_dups;
    00299     int dbi_no_fsync;
    00300     int dbi_no_dbsync;
    00301     int dbi_lockdbfd;
    00302     int dbi_temporary;
    00303     int dbi_debug;
    00304     int dbi_byteswapped;
    00305
    00306 /*@null@*/
    00307     char * dbi_host;
    00308     unsigned long dbi_cl_timeout;
    00309     unsigned long dbi_sv_timeout;
    00310
    00311         /* dbenv parameters */
    00312     int dbi_lorder;
    00313 /*@unused@*/
    00314     void (*db_errcall) (const char *db_errpfx, char *buffer)
    00315         /*@globals fileSystem @*/
    00316         /*@modifies fileSystem @*/;
    00317 /*@unused@*/ /*@shared@*/
    00318     FILE *      dbi_errfile;
    00319     const char * dbi_errpfx;
    00320     int dbi_verbose;
    00321     int dbi_region_init;
    00322     int dbi_tas_spins;
    00323         /* mpool sub-system parameters */
    00324     int dbi_mp_mmapsize;
    00325     int dbi_mp_size;
    00326         /* lock sub-system parameters */
    00327     unsigned int dbi_lk_max;
    00328     unsigned int dbi_lk_detect;
    00329 /*@unused@*/ int dbi_lk_nmodes;
    00330 /*@unused@*/ unsigned char * dbi_lk_conflicts;
    00331         /* log sub-system parameters */
    00332     unsigned int dbi_lg_max;
    00333     unsigned int dbi_lg_bsize;
    00334         /* transaction sub-system parameters */
    00335     unsigned int dbi_tx_max;
    00336 #if 0
    00337     int (*dbi_tx_recover) (DB_ENV *dbenv, DBT *log_rec,
    00338                                 DB_LSN *lsnp, int redo, void *info)
    00339         /*@globals fileSystem @*/
    00340         /*@modifies fileSystem @*/;
    00341 #endif
    00342         /* dbinfo parameters */
    00343     int dbi_cachesize;
    00344     int dbi_pagesize;
    00345 /*@unused@*/ /*@null@*/
    00346     void * (*dbi_malloc) (size_t nbytes)
    00347         /*@*/;
    00348         /* hash access parameters */
    00349     unsigned int dbi_h_ffactor;
    00350     unsigned int (*dbi_h_hash_fcn) (DB *, const void *bytes,
    00351                                 unsigned int length)
    00352         /*@*/;
    00353     unsigned int dbi_h_nelem;
    00354     unsigned int dbi_h_flags;
    00355     int (*dbi_h_dup_compare_fcn) (DB *, const DBT *, const DBT *)
    00356         /*@*/;
    00357         /* btree access parameters */
    00358     int dbi_bt_flags;
    00359     int dbi_bt_minkey;
    00360     int (*dbi_bt_compare_fcn) (DB *, const DBT *, const DBT *)
    00361         /*@*/;
    00362     int (*dbi_bt_dup_compare_fcn) (DB *, const DBT *, const DBT *)
    00363         /*@*/;
    00364     size_t (*dbi_bt_prefix_fcn) (DB *, const DBT *, const DBT *)
    00365         /*@*/;
    00366         /* recno access parameters */
    00367     int dbi_re_flags;
    00368     int dbi_re_delim;
    00369     unsigned int dbi_re_len;
    00370     int dbi_re_pad;
    00371     const char * dbi_re_source;
    00372         /* queue access parameters */
    00373     unsigned int dbi_q_extentsize;
    00374
    00375 /*@refcounted@*/
    00376     rpmdb dbi_rpmdb;
    00377     rpmTag dbi_rpmtag;
    00378     int dbi_jlen;
    00380 /*@only@*//*@null@*/
    00381     DB * dbi_db;
    00382 /*@only@*//*@null@*/
    00383     DB_TXN * dbi_txnid;
    00384 /*@only@*//*@null@*/
    00385     void * dbi_stats;
    00387 /*@observer@*/
    00388     const struct _dbiVec * dbi_vec;
    00390 };
    00391
    00395 struct rpmdb_s {
    00396 /*@owned@*/
    00397     const char * db_root;
    00398 /*@owned@*/
    00399     const char * db_home;
    00400     int         db_flags;
    00401     int         db_mode;
    00402     int         db_perms;
    00403     int         db_api;
    00404 /*@owned@*/
    00405     const char * db_errpfx;
    00406     int         db_remove_env;
    00407     int         db_filter_dups;
    00408     int         db_chrootDone;
    00409     void (*db_errcall) (const char *db_errpfx, char *buffer)
    00410         /*@*/;
    00411 /*@shared@*/
    00412     FILE *      db_errfile;
    00413 /*@only@*/
    00414     void * (*db_malloc) (size_t nbytes)
    00415         /*@*/;
    00416 /*@only@*/
    00417     void * (*db_realloc) (/*@only@*//*@null@*/ void * ptr,
    00418                                                 size_t nbytes)
    00419         /*@*/;
    00420     void (*db_free) (/*@only@*/ void * ptr)
    00421         /*@modifies *ptr @*/;
    00422 /*@only@*/ /*@null@*/
    00423     unsigned char * db_bits;
    00424     int         db_nbits;
    00425     rpmdb       db_next;
    00426     int         db_opens;
    00427 /*@only@*/ /*@null@*/
    00428     void *      db_dbenv;
    00429     int         db_ndbi;
    00430     dbiIndex * _dbi;
    00432 /*@refs@*/
    00433     int nrefs;
    00434 };
    00435
    00436 /* for RPM's internal use only */
    00437
    00440 enum rpmdbFlags {
    00441         RPMDB_FLAG_JUSTCHECK    = (1 << 0),
    00442         RPMDB_FLAG_MINIMAL      = (1 << 1),
    00443 /*@-enummemuse@*/
    00444         RPMDB_FLAG_CHROOT       = (1 << 2)
    00445 /*@=enummemuse@*/
    00446 };
    00447
    00448 #ifdef __cplusplus
    00449 extern "C" {
    00450 #endif
    00451
    00452 /*@-exportlocal@*/
    00459 /*@unused@*/ /*@only@*/ /*@null@*/
    00460 dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag)
    00461         /*@globals rpmGlobalMacroContext @*/
    00462         /*@modifies rpmGlobalMacroContext @*/;
    00463
    00469 /*@null@*/
    00470 dbiIndex db3Free( /*@only@*/ /*@null@*/ dbiIndex dbi)
    00471         /*@*/;
    00472
    00479 /*@-redecl@*/
    00480 /*@exposed@*/
    00481 extern const char *const prDbiOpenFlags(int dbflags, int print_dbenv_flags)
    00482         /*@*/;
    00483 /*@=redecl@*/
    00484
    00492 /*@only@*/ /*@null@*/ dbiIndex dbiOpen(/*@null@*/ rpmdb db, rpmTag rpmtag,
    00493                 unsigned int flags)
    00494         /*@globals rpmGlobalMacroContext, errno @*/
    00495         /*@modifies db, rpmGlobalMacroContext, errno @*/;
    00496
    00497 /*@-globuse -mustmod @*/ /* FIX: vector annotations */
    00506 /*@unused@*/ static inline
    00507 int dbiCopen(dbiIndex dbi, /*@null@*/ DB_TXN * txnid,
    00508                 /*@out@*/ DBC ** dbcp, unsigned int flags)
    00509         /*@globals fileSystem @*/
    00510         /*@modifies dbi, *dbcp, fileSystem @*/
    00511 {
    00512     return (*dbi->dbi_vec->copen) (dbi, txnid, dbcp, flags);
    00513 }
    00514
    00522 /*@unused@*/ static inline
    00523 int dbiCclose(dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags)
    00524         /*@globals fileSystem @*/
    00525         /*@modifies dbi, *dbcursor, fileSystem @*/
    00526 {
    00527     return (*dbi->dbi_vec->cclose) (dbi, dbcursor, flags);
    00528 }
    00529
    00538 /*@unused@*/ static inline
    00539 int dbiCdup(dbiIndex dbi, DBC * dbcursor, /*@out@*/ DBC ** dbcp,
    00540                 unsigned int flags)
    00541         /*@modifies dbi, *dbcp @*/
    00542 {
    00543     return (*dbi->dbi_vec->cdup) (dbi, dbcursor, dbcp, flags);
    00544 }
    00545
    00555 /*@unused@*/ static inline
    00556 int dbiDel(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
    00557                 unsigned int flags)
    00558         /*@globals fileSystem @*/
    00559         /*@modifies *dbcursor, fileSystem @*/
    00560 {
    00561     assert(key->data != NULL && key->size > 0);
    00562     return (dbi->dbi_vec->cdel) (dbi, dbcursor, key, data, flags);
    00563 }
    00564
    00574 /*@unused@*/ static inline
    00575 int dbiGet(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
    00576                 unsigned int flags)
    00577         /*@globals fileSystem @*/
    00578         /*@modifies *dbcursor, *key, *data, fileSystem @*/
    00579 {
    00580     assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0));
    00581     return (dbi->dbi_vec->cget) (dbi, dbcursor, key, data, flags);
    00582 }
    00583
    00594 /*@unused@*/ static inline
    00595 int dbiPget(dbiIndex dbi, /*@null@*/ DBC * dbcursor,
    00596                 DBT * key, DBT * pkey, DBT * data, unsigned int flags)
    00597         /*@globals fileSystem @*/
    00598         /*@modifies *dbcursor, *key, *pkey, *data, fileSystem @*/
    00599 {
    00600     assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0));
    00601     return (dbi->dbi_vec->cpget) (dbi, dbcursor, key, pkey, data, flags);
    00602 }
    00603
    00613 /*@unused@*/ static inline
    00614 int dbiPut(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
    00615                 unsigned int flags)
    00616         /*@globals fileSystem @*/
    00617         /*@modifies *dbcursor, *key, fileSystem @*/
    00618 {
    00619     assert(key->data != NULL && key->size > 0 && data->data != NULL && data->size > 0);
    00620     return (dbi->dbi_vec->cput) (dbi, dbcursor, key, data, flags);
    00621 }
    00622
    00631 /*@unused@*/ static inline
    00632 int dbiCount(dbiIndex dbi, DBC * dbcursor, /*@out@*/ unsigned int * countp,
    00633                 unsigned int flags)
    00634         /*@globals fileSystem @*/
    00635         /*@modifies *dbcursor, fileSystem @*/
    00636 {
    00637     return (*dbi->dbi_vec->ccount) (dbi, dbcursor, countp, flags);
    00638 }
    00639
    00646 /*@unused@*/ static inline
    00647 int dbiVerify(/*@only@*/ dbiIndex dbi, unsigned int flags)
    00648         /*@globals fileSystem @*/
    00649         /*@modifies dbi, fileSystem @*/
    00650 {
    00651     dbi->dbi_verify_on_close = 1;
    00652     return (*dbi->dbi_vec->close) (dbi, flags);
    00653 }
    00654
    00661 /*@unused@*/ static inline
    00662 int dbiClose(/*@only@*/ dbiIndex dbi, unsigned int flags)
    00663         /*@globals fileSystem @*/
    00664         /*@modifies dbi, fileSystem @*/
    00665 {
    00666     return (*dbi->dbi_vec->close) (dbi, flags);
    00667 }
    00668
    00675 /*@unused@*/ static inline
    00676 int dbiSync (dbiIndex dbi, unsigned int flags)
    00677         /*@globals fileSystem @*/
    00678         /*@modifies fileSystem @*/
    00679 {
    00680     return (*dbi->dbi_vec->sync) (dbi, flags);
    00681 }
    00682
    00691 /*@unused@*/ static inline
    00692 int dbiAssociate(dbiIndex dbi, dbiIndex dbisecondary,
    00693                 int (*callback) (DB *, const DBT *, const DBT *, DBT *),
    00694                 unsigned int flags)
    00695         /*@globals fileSystem @*/
    00696         /*@modifies dbi, fileSystem @*/
    00697 {
    00698     return (*dbi->dbi_vec->associate) (dbi, dbisecondary, callback, flags);
    00699 }
    00700
    00709 /*@unused@*/ static inline
    00710 int dbiJoin(dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp,
    00711                 unsigned int flags)
    00712         /*@globals fileSystem @*/
    00713         /*@modifies dbi, *dbcp, fileSystem @*/
    00714 {
    00715     return (*dbi->dbi_vec->join) (dbi, curslist, dbcp, flags);
    00716 }
    00717
    00723 /*@unused@*/ static inline
    00724 int dbiByteSwapped(dbiIndex dbi)
    00725         /*@modifies dbi @*/
    00726 {
    00727     if (dbi->dbi_byteswapped == -1)
    00728         dbi->dbi_byteswapped = (*dbi->dbi_vec->byteswapped) (dbi);
    00729     return dbi->dbi_byteswapped;
    00730 }
    00737 /*@unused@*/ static inline
    00738 int dbiStat(dbiIndex dbi, unsigned int flags)
    00739         /*@modifies dbi @*/
    00740 {
    00741     return (*dbi->dbi_vec->stat) (dbi, flags);
    00742 }
    00743 /*@=globuse =mustmod @*/
    00744
    00745 /*@=exportlocal@*/
    00746
    00749 unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi)
    00750         /*@*/;
    00751
    00757 /*@null@*/ dbiIndexSet dbiFreeIndexSet(/*@only@*/ /*@null@*/ dbiIndexSet set)
    00758         /*@modifies set @*/;
    00759
    00765 unsigned int dbiIndexSetCount(dbiIndexSet set)
    00766         /*@*/;
    00767
    00774 unsigned int dbiIndexRecordOffset(dbiIndexSet set, int recno)
    00775         /*@*/;
    00776
    00783 unsigned int dbiIndexRecordFileNumber(dbiIndexSet set, int recno)
    00784         /*@*/;
    00785
    00789 /*@-exportlocal@*/
    00790 /*@unchecked@*/
    00791 /*@only@*/ /*@null@*/ extern int * dbiTags;
    00792 /*@unchecked@*/
    00793 extern int dbiTagsMax;
    00794 /*@=exportlocal@*/
    00795
    00802 /*@unused@*/ /*@null@*/
    00803 rpmdb rpmdbUnlink (/*@killref@*/ /*@only@*/ rpmdb db, const char * msg)
    00804         /*@modifies db @*/;
    00805
    00807 /*@-exportlocal@*/
    00808 /*@null@*/
    00809 rpmdb XrpmdbUnlink (/*@killref@*/ /*@only@*/ rpmdb db, const char * msg,
    00810                 const char * fn, unsigned ln)
    00811         /*@modifies db @*/;
    00812 /*@=exportlocal@*/
    00813 #define rpmdbUnlink(_db, _msg)  XrpmdbUnlink(_db, _msg, __FILE__, __LINE__)
    00814
    00821 /*@unused@*/
    00822 rpmdb rpmdbLink (rpmdb db, const char * msg)
    00823         /*@modifies db @*/;
    00824
    00826 /*@-exportlocal@*/
    00827 rpmdb XrpmdbLink (rpmdb db, const char * msg,
    00828                 const char * fn, unsigned ln)
    00829         /*@modifies db @*/;
    00830 /*@=exportlocal@*/
    00831 #define rpmdbLink(_db, _msg)    XrpmdbLink(_db, _msg, __FILE__, __LINE__)
    00832
    00841 int rpmdbOpen (/*@null@*/ const char * prefix, /*@null@*/ /*@out@*/ rpmdb * dbp,
    00842                 int mode, int perms)
    00843         /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
    00844         /*@modifies *dbp, rpmGlobalMacroContext, fileSystem, internalState @*/;
    00845
    00852 int rpmdbInit(/*@null@*/ const char * prefix, int perms)
    00853         /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
    00854         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
    00855
    00861 int rpmdbVerify(/*@null@*/ const char * prefix)
    00862         /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
    00863         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
    00864
    00871 int rpmdbCloseDBI(/*@null@*/ rpmdb db, int rpmtag)
    00872         /*@globals fileSystem @*/
    00873         /*@modifies db, fileSystem @*/;
    00874
    00880 int rpmdbClose (/*@killref@*/ /*@only@*/ /*@null@*/ rpmdb db)
    00881         /*@globals fileSystem @*/
    00882         /*@modifies db, fileSystem @*/;
    00883
    00889 int rpmdbSync (/*@null@*/ rpmdb db)
    00890         /*@globals fileSystem @*/
    00891         /*@modifies fileSystem @*/;
    00892
    00898 /*@-exportlocal@*/
    00899 int rpmdbOpenAll (/*@null@*/ rpmdb db)
    00900         /*@globals rpmGlobalMacroContext @*/
    00901         /*@modifies db, rpmGlobalMacroContext @*/;
    00902 /*@=exportlocal@*/
    00903
    00910 int rpmdbCountPackages(/*@null@*/ rpmdb db, const char * name)
    00911         /*@globals rpmGlobalMacroContext, fileSystem @*/
    00912         /*@modifies db, rpmGlobalMacroContext, fileSystem @*/;
    00913
    00919 unsigned int rpmdbGetIteratorOffset(/*@null@*/ rpmdbMatchIterator mi)
    00920         /*@*/;
    00921
    00927 int rpmdbGetIteratorCount(/*@null@*/ rpmdbMatchIterator mi)
    00928         /*@*/;
    00929
    00937 int rpmdbAppendIterator(/*@null@*/ rpmdbMatchIterator mi,
    00938                 /*@null@*/ const int * hdrNums, int nHdrNums)
    00939         /*@modifies mi @*/;
    00940
    00950 int rpmdbPruneIterator(/*@null@*/ rpmdbMatchIterator mi,
    00951                 /*@null@*/ int * hdrNums, int nHdrNums, int sorted)
    00952         /*@modifies mi, hdrNums @*/;
    00953
    00962 int rpmdbSetIteratorRE(/*@null@*/ rpmdbMatchIterator mi, rpmTag tag,
    00963                 rpmMireMode mode, /*@null@*/ const char * pattern)
    00964         /*@globals rpmGlobalMacroContext @*/
    00965         /*@modifies mi, mode, rpmGlobalMacroContext @*/;
    00966
    00974 int rpmdbSetIteratorRewrite(/*@null@*/ rpmdbMatchIterator mi, int rewrite)
    00975         /*@modifies mi @*/;
    00976
    00983 int rpmdbSetIteratorModified(/*@null@*/ rpmdbMatchIterator mi, int modified)
    00984         /*@modifies mi @*/;
    00985
    00993 int rpmdbSetHdrChk(/*@null@*/ rpmdbMatchIterator mi, /*@null@*/ rpmts ts,
    00994                 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void * uh, size_t uc, const char ** msg))
    00995         /*@modifies mi @*/;
    00996
    01005 /*@only@*/ /*@null@*/
    01006 rpmdbMatchIterator rpmdbInitIterator(/*@null@*/ rpmdb db, rpmTag rpmtag,
    01007                         /*@null@*/ const void * keyp, size_t keylen)
    01008         /*@globals rpmGlobalMacroContext, fileSystem @*/
    01009         /*@modifies db, rpmGlobalMacroContext, fileSystem @*/;
    01010
    01016 /*@null@*/
    01017 Header rpmdbNextIterator(/*@null@*/ rpmdbMatchIterator mi)
    01018         /*@globals rpmGlobalMacroContext, fileSystem @*/
    01019         /*@modifies mi, rpmGlobalMacroContext, fileSystem @*/;
    01020
    01024 /*@mayexit@*/
    01025 int rpmdbCheckSignals(void)
    01026         /*@globals fileSystem @*/
    01027         /*@modifies fileSystem @*/;
    01028
    01034 /*@null@*/
    01035 rpmdbMatchIterator rpmdbFreeIterator(/*@only@*/ /*@null@*/rpmdbMatchIterator mi)
    01036         /*@globals rpmGlobalMacroContext, fileSystem @*/
    01037         /*@modifies mi, rpmGlobalMacroContext, fileSystem @*/;
    01038
    01048 int rpmdbAdd(/*@null@*/ rpmdb db, int iid, Header h, /*@null@*/ rpmts ts,
    01049                 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg))
    01050         /*@globals rpmGlobalMacroContext, fileSystem @*/
    01051         /*@modifies db, h, rpmGlobalMacroContext, fileSystem @*/;
    01052
    01062 int rpmdbRemove(/*@null@*/ rpmdb db, /*@unused@*/ int rid, unsigned int hdrNum,
    01063                 /*@null@*/ rpmts ts,
    01064                 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg))
    01065         /*@globals rpmGlobalMacroContext, fileSystem @*/
    01066         /*@modifies db, rpmGlobalMacroContext, fileSystem @*/;
    01067
    01075 int rpmdbRebuild(/*@null@*/ const char * prefix, /*@null@*/ rpmts ts,
    01076                 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg))
    01077         /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
    01078         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
    01079
    01083 /*@unused@*/
    01084 int mergesort(void *base, size_t nmemb, size_t size,
    01085                 int (*cmp) (const void *, const void *))
    01086         /*@globals errno @*/
    01087         /*@modifies base, errno @*/;
    01088
    01089 #ifdef __cplusplus
    01090 }
    01091 #endif
    01092
    01093 /*@=bounds@*/
    01094 #endif  /* H_RPMDB */