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 "rpmsw.h"
00013 #include "db.h"
00014 
00015 /*@-exportlocal@*/
00016 /*@unchecked@*/
00017 extern int _rpmdb_debug;
00018 /*@=exportlocal@*/
00019 
00020 #ifdef  NOTYET
00021 
00024 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmdb_s * rpmdb;
00025 
00029 typedef /*@abstract@*/ struct _rpmdbMatchIterator * rpmdbMatchIterator;
00030 #endif
00031 
00035 typedef enum rpmMireMode_e {
00036     RPMMIRE_DEFAULT     = 0,    
00037     RPMMIRE_STRCMP      = 1,    
00038     RPMMIRE_REGEX       = 2,    
00039     RPMMIRE_GLOB        = 3     
00040 } rpmMireMode;
00041 
00044 typedef /*@abstract@*/ struct _dbiIndexItem * dbiIndexItem;
00045 
00049 typedef /*@abstract@*/ struct _dbiIndexSet * dbiIndexSet;
00050 
00053 typedef /*@abstract@*/ struct _dbiIndex * dbiIndex;
00054 
00055 /* this will break if sizeof(int) != 4 */
00061 struct _dbiIndexItem {
00062     unsigned int hdrNum;                
00063     unsigned int tagNum;                
00064     unsigned int fpNum;                 
00065 };
00066 
00070 struct _dbiIndexSet {
00071 /*@owned@*/ struct _dbiIndexItem * recs; 
00072     int count;                          
00073 };
00074 
00078 struct _dbiVec {
00079     int dbv_major;                      
00080     int dbv_minor;                      
00081     int dbv_patch;                      
00089     int (*open) (rpmdb rpmdb, rpmTag rpmtag, /*@out@*/ dbiIndex * dbip)
00090         /*@globals fileSystem @*/
00091         /*@modifies *dbip, fileSystem @*/;
00092 
00099     int (*close) (/*@only@*/ dbiIndex dbi, unsigned int flags)
00100         /*@globals fileSystem @*/
00101         /*@modifies dbi, fileSystem @*/;
00102 
00109     int (*sync) (dbiIndex dbi, unsigned int flags)
00110         /*@globals fileSystem @*/
00111         /*@modifies fileSystem @*/;
00112 
00121     int (*associate) (dbiIndex dbi, dbiIndex dbisecondary,
00122                 int (*callback) (DB *, const DBT *, const DBT *, DBT *),
00123                 unsigned int flags)
00124         /*@globals fileSystem @*/
00125         /*@modifies dbi, fileSystem @*/;
00126 
00135     int (*join) (dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp,
00136                 unsigned int flags)
00137         /*@globals fileSystem @*/
00138         /*@modifies dbi, *dbcp, fileSystem @*/;
00139 
00148     int (*copen) (dbiIndex dbi, /*@null@*/ DB_TXN * txnid,
00149                         /*@out@*/ DBC ** dbcp, unsigned int dbiflags)
00150         /*@globals fileSystem @*/
00151         /*@modifies dbi, *txnid, *dbcp, fileSystem @*/;
00152 
00160     int (*cclose) (dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags)
00161         /*@globals fileSystem @*/
00162         /*@modifies dbi, *dbcursor, fileSystem @*/;
00163 
00172     int (*cdup) (dbiIndex dbi, DBC * dbcursor, /*@out@*/ DBC ** dbcp,
00173                 unsigned int flags)
00174         /*@globals fileSystem @*/
00175         /*@modifies dbi, *dbcp, fileSystem @*/;
00176 
00186     int (*cdel) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
00187                         unsigned int flags)
00188         /*@globals fileSystem @*/
00189         /*@modifies *dbcursor, fileSystem @*/;
00190 
00200     int (*cget) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
00201                         unsigned int flags)
00202         /*@globals fileSystem @*/
00203         /*@modifies *dbcursor, *key, *data, fileSystem @*/;
00204 
00215     int (*cpget) (dbiIndex dbi, /*@null@*/ DBC * dbcursor,
00216                 DBT * key, DBT * pkey, DBT * data, unsigned int flags)
00217         /*@globals fileSystem @*/
00218         /*@modifies *dbcursor, *key, *pkey, *data, fileSystem @*/;
00219 
00229     int (*cput) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
00230                         unsigned int flags)
00231         /*@globals fileSystem @*/
00232         /*@modifies *dbcursor, fileSystem @*/;
00233 
00242     int (*ccount) (dbiIndex dbi, DBC * dbcursor,
00243                         /*@out@*/ unsigned int * countp,
00244                         unsigned int flags)
00245         /*@globals fileSystem @*/
00246         /*@modifies *dbcursor, fileSystem @*/;
00247 
00253     int (*byteswapped) (dbiIndex dbi)
00254         /*@globals fileSystem @*/
00255         /*@modifies fileSystem @*/;
00256 
00263     int (*stat) (dbiIndex dbi, unsigned int flags)
00264         /*@globals fileSystem @*/
00265         /*@modifies dbi, fileSystem @*/;
00266 };
00267 
00271 struct _dbiIndex {
00272 /*@null@*/
00273     const char * dbi_root;      
00274 /*@null@*/
00275     const char * dbi_home;      
00276 /*@relnull@*/
00277     const char * dbi_file;      
00278 /*@relnull@*/
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     /* XXX db-4.3.14 adds dbenv as 1st arg. */
00315     void (*db_errcall) (void * dbenv, const char *db_errpfx, char *buffer)
00316         /*@globals fileSystem @*/
00317         /*@modifies fileSystem @*/;
00318 /*@unused@*/ /*@shared@*/
00319     FILE *      dbi_errfile;
00320     const char * dbi_errpfx;
00321     int dbi_verbose;
00322     int dbi_region_init;
00323     int dbi_tas_spins;
00324         /* mpool sub-system parameters */
00325     int dbi_mmapsize;   
00326     int dbi_cachesize;  
00327         /* lock sub-system parameters */
00328     unsigned int dbi_lk_max;
00329     unsigned int dbi_lk_detect;
00330 /*@unused@*/ int dbi_lk_nmodes;
00331 /*@unused@*/ unsigned char * dbi_lk_conflicts;
00332         /* log sub-system parameters */
00333     unsigned int dbi_lg_max;
00334     unsigned int dbi_lg_bsize;
00335         /* transaction sub-system parameters */
00336     unsigned int dbi_tx_max;
00337 #if 0
00338     int (*dbi_tx_recover) (DB_ENV *dbenv, DBT *log_rec,
00339                                 DB_LSN *lsnp, int redo, void *info)
00340         /*@globals fileSystem @*/
00341         /*@modifies fileSystem @*/;
00342 #endif
00343         /* dbinfo parameters */
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     struct rpmop_s db_getops;
00433     struct rpmop_s db_putops;
00434     struct rpmop_s db_delops;
00435 
00436 /*@refs@*/
00437     int nrefs;                  
00438 };
00439 
00440 /* for RPM's internal use only */
00441 
00444 enum rpmdbFlags {
00445         RPMDB_FLAG_JUSTCHECK    = (1 << 0),
00446         RPMDB_FLAG_MINIMAL      = (1 << 1),
00447 /*@-enummemuse@*/
00448         RPMDB_FLAG_CHROOT       = (1 << 2)
00449 /*@=enummemuse@*/
00450 };
00451 
00452 #ifdef __cplusplus
00453 extern "C" {
00454 #endif
00455 
00456 /*@-exportlocal@*/
00463 /*@unused@*/ /*@only@*/ /*@null@*/
00464 dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag)
00465         /*@globals rpmGlobalMacroContext, h_errno @*/
00466         /*@modifies rpmGlobalMacroContext @*/;
00467 
00473 /*@null@*/
00474 dbiIndex db3Free( /*@only@*/ /*@null@*/ dbiIndex dbi)
00475         /*@*/;
00476 
00483 /*@-redecl@*/
00484 /*@exposed@*/
00485 extern const char *const prDbiOpenFlags(int dbflags, int print_dbenv_flags)
00486         /*@*/;
00487 /*@=redecl@*/
00488 
00496 /*@only@*/ /*@null@*/ dbiIndex dbiOpen(/*@null@*/ rpmdb db, rpmTag rpmtag,
00497                 unsigned int flags)
00498         /*@globals rpmGlobalMacroContext, errno, h_errno @*/
00499         /*@modifies db, rpmGlobalMacroContext, errno @*/;
00500 
00501 /*@-globuse -mustmod @*/ /* FIX: vector annotations */
00510 /*@unused@*/ static inline
00511 int dbiCopen(dbiIndex dbi, /*@null@*/ DB_TXN * txnid,
00512                 /*@out@*/ DBC ** dbcp, unsigned int flags)
00513         /*@globals fileSystem @*/
00514         /*@modifies dbi, *dbcp, fileSystem @*/
00515 {
00516     return (*dbi->dbi_vec->copen) (dbi, txnid, dbcp, flags);
00517 }
00518 
00526 /*@unused@*/ static inline
00527 int dbiCclose(dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags)
00528         /*@globals fileSystem @*/
00529         /*@modifies dbi, *dbcursor, fileSystem @*/
00530 {
00531     return (*dbi->dbi_vec->cclose) (dbi, dbcursor, flags);
00532 }
00533 
00542 /*@unused@*/ static inline
00543 int dbiCdup(dbiIndex dbi, DBC * dbcursor, /*@out@*/ DBC ** dbcp,
00544                 unsigned int flags)
00545         /*@modifies dbi, *dbcp @*/
00546 {
00547     return (*dbi->dbi_vec->cdup) (dbi, dbcursor, dbcp, flags);
00548 }
00549 
00559 /*@unused@*/ static inline
00560 int dbiDel(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
00561                 unsigned int flags)
00562         /*@globals fileSystem, internalState @*/
00563         /*@modifies dbi, *dbcursor, fileSystem, internalState @*/
00564 {
00565     int rc;
00566     assert(key->data != NULL && key->size > 0);
00567     (void) rpmswEnter(&dbi->dbi_rpmdb->db_delops, 0);
00568     rc = (dbi->dbi_vec->cdel) (dbi, dbcursor, key, data, flags);
00569     (void) rpmswExit(&dbi->dbi_rpmdb->db_delops, data->size);
00570     return rc;
00571 }
00572 
00582 /*@unused@*/ static inline
00583 int dbiGet(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
00584                 unsigned int flags)
00585         /*@globals fileSystem, internalState @*/
00586         /*@modifies dbi, *dbcursor, *key, *data, fileSystem, internalState @*/
00587 {
00588     int rc;
00589     assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0));
00590     (void) rpmswEnter(&dbi->dbi_rpmdb->db_getops, 0);
00591     rc = (dbi->dbi_vec->cget) (dbi, dbcursor, key, data, flags);
00592     (void) rpmswExit(&dbi->dbi_rpmdb->db_getops, data->size);
00593     return rc;
00594 }
00595 
00606 /*@unused@*/ static inline
00607 int dbiPget(dbiIndex dbi, /*@null@*/ DBC * dbcursor,
00608                 DBT * key, DBT * pkey, DBT * data, unsigned int flags)
00609         /*@globals fileSystem, internalState @*/
00610         /*@modifies dbi, *dbcursor, *key, *pkey, *data, fileSystem, internalState @*/
00611 {
00612     int rc;
00613     assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0));
00614     (void) rpmswEnter(&dbi->dbi_rpmdb->db_getops, 0);
00615     rc = (dbi->dbi_vec->cpget) (dbi, dbcursor, key, pkey, data, flags);
00616     (void) rpmswExit(&dbi->dbi_rpmdb->db_getops, data->size);
00617     return rc;
00618 }
00619 
00629 /*@unused@*/ static inline
00630 int dbiPut(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
00631                 unsigned int flags)
00632         /*@globals fileSystem, internalState @*/
00633         /*@modifies dbi, *dbcursor, *key, fileSystem, internalState @*/
00634 {
00635     int rc;
00636     assert(key->data != NULL && key->size > 0 && data->data != NULL && data->size > 0);
00637     (void) rpmswEnter(&dbi->dbi_rpmdb->db_putops, 0);
00638     rc = (dbi->dbi_vec->cput) (dbi, dbcursor, key, data, flags);
00639     (void) rpmswExit(&dbi->dbi_rpmdb->db_putops, data->size);
00640     return rc;
00641 }
00642 
00651 /*@unused@*/ static inline
00652 int dbiCount(dbiIndex dbi, DBC * dbcursor, /*@out@*/ unsigned int * countp,
00653                 unsigned int flags)
00654         /*@globals fileSystem @*/
00655         /*@modifies *dbcursor, fileSystem @*/
00656 {
00657     return (*dbi->dbi_vec->ccount) (dbi, dbcursor, countp, flags);
00658 }
00659 
00666 /*@unused@*/ static inline
00667 int dbiVerify(/*@only@*/ dbiIndex dbi, unsigned int flags)
00668         /*@globals fileSystem @*/
00669         /*@modifies dbi, fileSystem @*/
00670 {
00671     dbi->dbi_verify_on_close = 1;
00672     return (*dbi->dbi_vec->close) (dbi, flags);
00673 }
00674 
00681 /*@unused@*/ static inline
00682 int dbiClose(/*@only@*/ dbiIndex dbi, unsigned int flags)
00683         /*@globals fileSystem @*/
00684         /*@modifies dbi, fileSystem @*/
00685 {
00686     return (*dbi->dbi_vec->close) (dbi, flags);
00687 }
00688 
00695 /*@unused@*/ static inline
00696 int dbiSync (dbiIndex dbi, unsigned int flags)
00697         /*@globals fileSystem @*/
00698         /*@modifies fileSystem @*/
00699 {
00700     return (*dbi->dbi_vec->sync) (dbi, flags);
00701 }
00702 
00711 /*@unused@*/ static inline
00712 int dbiAssociate(dbiIndex dbi, dbiIndex dbisecondary,
00713                 int (*callback) (DB *, const DBT *, const DBT *, DBT *),
00714                 unsigned int flags)
00715         /*@globals fileSystem @*/
00716         /*@modifies dbi, fileSystem @*/
00717 {
00718     return (*dbi->dbi_vec->associate) (dbi, dbisecondary, callback, flags);
00719 }
00720 
00729 /*@unused@*/ static inline
00730 int dbiJoin(dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp,
00731                 unsigned int flags)
00732         /*@globals fileSystem @*/
00733         /*@modifies dbi, *dbcp, fileSystem @*/
00734 {
00735     return (*dbi->dbi_vec->join) (dbi, curslist, dbcp, flags);
00736 }
00737 
00743 /*@unused@*/ static inline
00744 int dbiByteSwapped(dbiIndex dbi)
00745         /*@modifies dbi @*/
00746 {
00747     if (dbi->dbi_byteswapped == -1)
00748         dbi->dbi_byteswapped = (*dbi->dbi_vec->byteswapped) (dbi);
00749     return dbi->dbi_byteswapped;
00750 }
00757 /*@unused@*/ static inline
00758 int dbiStat(dbiIndex dbi, unsigned int flags)
00759         /*@modifies dbi @*/
00760 {
00761     return (*dbi->dbi_vec->stat) (dbi, flags);
00762 }
00763 /*@=globuse =mustmod @*/
00764 
00765 /*@=exportlocal@*/
00766 
00769 unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi)
00770         /*@*/;
00771 
00777 /*@null@*/ dbiIndexSet dbiFreeIndexSet(/*@only@*/ /*@null@*/ dbiIndexSet set)
00778         /*@modifies set @*/;
00779 
00785 unsigned int dbiIndexSetCount(dbiIndexSet set)
00786         /*@*/;
00787 
00794 unsigned int dbiIndexRecordOffset(dbiIndexSet set, int recno)
00795         /*@*/;
00796 
00803 unsigned int dbiIndexRecordFileNumber(dbiIndexSet set, int recno)
00804         /*@*/;
00805 
00809 /*@-exportlocal@*/
00810 /*@unchecked@*/
00811 /*@only@*/ /*@null@*/ extern int * dbiTags;
00812 /*@unchecked@*/
00813 extern int dbiTagsMax;
00814 /*@=exportlocal@*/
00815 
00822 /*@unused@*/ /*@null@*/
00823 rpmdb rpmdbUnlink (/*@killref@*/ /*@only@*/ rpmdb db, const char * msg)
00824         /*@modifies db @*/;
00825 
00827 /*@-exportlocal@*/
00828 /*@null@*/
00829 rpmdb XrpmdbUnlink (/*@killref@*/ /*@only@*/ rpmdb db, const char * msg,
00830                 const char * fn, unsigned ln)
00831         /*@modifies db @*/;
00832 /*@=exportlocal@*/
00833 #define rpmdbUnlink(_db, _msg)  XrpmdbUnlink(_db, _msg, __FILE__, __LINE__)
00834 
00841 /*@unused@*/
00842 rpmdb rpmdbLink (rpmdb db, const char * msg)
00843         /*@modifies db @*/;
00844 
00846 /*@-exportlocal@*/
00847 rpmdb XrpmdbLink (rpmdb db, const char * msg,
00848                 const char * fn, unsigned ln)
00849         /*@modifies db @*/;
00850 /*@=exportlocal@*/
00851 #define rpmdbLink(_db, _msg)    XrpmdbLink(_db, _msg, __FILE__, __LINE__)
00852 
00861 int rpmdbOpen (/*@null@*/ const char * prefix, /*@null@*/ /*@out@*/ rpmdb * dbp,
00862                 int mode, int perms)
00863         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00864         /*@modifies *dbp, rpmGlobalMacroContext, fileSystem, internalState @*/;
00865 
00872 int rpmdbInit(/*@null@*/ const char * prefix, int perms)
00873         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00874         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
00875 
00881 int rpmdbVerify(/*@null@*/ const char * prefix)
00882         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00883         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
00884 
00891 int rpmdbCloseDBI(/*@null@*/ rpmdb db, int rpmtag)
00892         /*@globals fileSystem @*/
00893         /*@modifies db, fileSystem @*/;
00894 
00900 int rpmdbClose (/*@killref@*/ /*@only@*/ /*@null@*/ rpmdb db)
00901         /*@globals fileSystem @*/
00902         /*@modifies db, fileSystem @*/;
00903 
00909 int rpmdbSync (/*@null@*/ rpmdb db)
00910         /*@globals fileSystem @*/
00911         /*@modifies fileSystem @*/;
00912 
00918 /*@-exportlocal@*/
00919 int rpmdbOpenAll (/*@null@*/ rpmdb db)
00920         /*@globals rpmGlobalMacroContext, h_errno @*/
00921         /*@modifies db, rpmGlobalMacroContext @*/;
00922 /*@=exportlocal@*/
00923 
00930 int rpmdbCountPackages(/*@null@*/ rpmdb db, const char * name)
00931         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00932         /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
00933 
00939 unsigned int rpmdbGetIteratorOffset(/*@null@*/ rpmdbMatchIterator mi)
00940         /*@*/;
00941 
00947 int rpmdbGetIteratorCount(/*@null@*/ rpmdbMatchIterator mi)
00948         /*@*/;
00949 
00957 int rpmdbAppendIterator(/*@null@*/ rpmdbMatchIterator mi,
00958                 /*@null@*/ const int * hdrNums, int nHdrNums)
00959         /*@modifies mi @*/;
00960 
00970 int rpmdbPruneIterator(/*@null@*/ rpmdbMatchIterator mi,
00971                 /*@null@*/ int * hdrNums, int nHdrNums, int sorted)
00972         /*@modifies mi, hdrNums @*/;
00973 
00982 int rpmdbSetIteratorRE(/*@null@*/ rpmdbMatchIterator mi, rpmTag tag,
00983                 rpmMireMode mode, /*@null@*/ const char * pattern)
00984         /*@globals rpmGlobalMacroContext, h_errno @*/
00985         /*@modifies mi, mode, rpmGlobalMacroContext @*/;
00986 
00994 int rpmdbSetIteratorRewrite(/*@null@*/ rpmdbMatchIterator mi, int rewrite)
00995         /*@modifies mi @*/;
00996 
01003 int rpmdbSetIteratorModified(/*@null@*/ rpmdbMatchIterator mi, int modified)
01004         /*@modifies mi @*/;
01005 
01013 int rpmdbSetHdrChk(/*@null@*/ rpmdbMatchIterator mi, /*@null@*/ rpmts ts,
01014                 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void * uh, size_t uc, const char ** msg))
01015         /*@modifies mi @*/;
01016 
01025 /*@only@*/ /*@null@*/
01026 rpmdbMatchIterator rpmdbInitIterator(/*@null@*/ rpmdb db, rpmTag rpmtag,
01027                         /*@null@*/ const void * keyp, size_t keylen)
01028         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
01029         /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
01030 
01036 /*@null@*/
01037 Header rpmdbNextIterator(/*@null@*/ rpmdbMatchIterator mi)
01038         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
01039         /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
01040 
01044 /*@mayexit@*/
01045 int rpmdbCheckSignals(void)
01046         /*@globals fileSystem, internalState @*/
01047         /*@modifies fileSystem, internalState @*/;
01048 
01057 int rpmdbCheckTerminate(int terminate);
01058 
01064 /*@null@*/
01065 rpmdbMatchIterator rpmdbFreeIterator(/*@only@*/ /*@null@*/rpmdbMatchIterator mi)
01066         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
01067         /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
01068 
01078 int rpmdbAdd(/*@null@*/ rpmdb db, int iid, Header h, /*@null@*/ rpmts ts,
01079                 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg))
01080         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
01081         /*@modifies db, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
01082 
01092 int rpmdbRemove(/*@null@*/ rpmdb db, /*@unused@*/ int rid, unsigned int hdrNum,
01093                 /*@null@*/ rpmts ts,
01094                 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg))
01095         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
01096         /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
01097 
01105 int rpmdbRebuild(/*@null@*/ const char * prefix, /*@null@*/ rpmts ts,
01106                 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg))
01107         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
01108         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
01109 
01110 #ifndef __APPLE__
01111 
01114 /*@unused@*/
01115 int mergesort(void *base, size_t nmemb, size_t size,
01116                 int (*cmp) (const void *, const void *))
01117         /*@globals errno @*/
01118         /*@modifies base, errno @*/;
01119 #else
01120 /* mergesort is defined in stdlib.h on Mac OS X */
01121 #endif /* __APPLE__ */
01122 
01123 #ifdef __cplusplus
01124 }
01125 #endif
01126 
01127 /*@=bounds@*/
01128 #endif  /* H_RPMDB */

Generated on Fri Oct 12 08:44:54 2007 for rpm by  doxygen 1.5.2