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     size_t alloced;                     /*< alloced size */
00074 };
00075 
00079 struct _dbiVec {
00080     int dbv_major;                      
00081     int dbv_minor;                      
00082     int dbv_patch;                      
00090     int (*open) (rpmdb rpmdb, rpmTag rpmtag, /*@out@*/ dbiIndex * dbip)
00091         /*@globals fileSystem @*/
00092         /*@modifies *dbip, fileSystem @*/;
00093 
00100     int (*close) (/*@only@*/ dbiIndex dbi, unsigned int flags)
00101         /*@globals fileSystem @*/
00102         /*@modifies dbi, fileSystem @*/;
00103 
00110     int (*sync) (dbiIndex dbi, unsigned int flags)
00111         /*@globals fileSystem @*/
00112         /*@modifies fileSystem @*/;
00113 
00122     int (*associate) (dbiIndex dbi, dbiIndex dbisecondary,
00123                 int (*callback) (DB *, const DBT *, const DBT *, DBT *),
00124                 unsigned int flags)
00125         /*@globals fileSystem @*/
00126         /*@modifies dbi, fileSystem @*/;
00127 
00136     int (*join) (dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp,
00137                 unsigned int flags)
00138         /*@globals fileSystem @*/
00139         /*@modifies dbi, *dbcp, fileSystem @*/;
00140 
00149     int (*copen) (dbiIndex dbi, /*@null@*/ DB_TXN * txnid,
00150                         /*@out@*/ DBC ** dbcp, unsigned int dbiflags)
00151         /*@globals fileSystem @*/
00152         /*@modifies dbi, *txnid, *dbcp, fileSystem @*/;
00153 
00161     int (*cclose) (dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags)
00162         /*@globals fileSystem @*/
00163         /*@modifies dbi, *dbcursor, fileSystem @*/;
00164 
00173     int (*cdup) (dbiIndex dbi, DBC * dbcursor, /*@out@*/ DBC ** dbcp,
00174                 unsigned int flags)
00175         /*@globals fileSystem @*/
00176         /*@modifies dbi, *dbcp, fileSystem @*/;
00177 
00187     int (*cdel) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
00188                         unsigned int flags)
00189         /*@globals fileSystem @*/
00190         /*@modifies *dbcursor, fileSystem @*/;
00191 
00201     int (*cget) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
00202                         unsigned int flags)
00203         /*@globals fileSystem @*/
00204         /*@modifies *dbcursor, *key, *data, fileSystem @*/;
00205 
00216     int (*cpget) (dbiIndex dbi, /*@null@*/ DBC * dbcursor,
00217                 DBT * key, DBT * pkey, DBT * data, unsigned int flags)
00218         /*@globals fileSystem @*/
00219         /*@modifies *dbcursor, *key, *pkey, *data, fileSystem @*/;
00220 
00230     int (*cput) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
00231                         unsigned int flags)
00232         /*@globals fileSystem @*/
00233         /*@modifies *dbcursor, fileSystem @*/;
00234 
00243     int (*ccount) (dbiIndex dbi, DBC * dbcursor,
00244                         /*@out@*/ unsigned int * countp,
00245                         unsigned int flags)
00246         /*@globals fileSystem @*/
00247         /*@modifies *dbcursor, fileSystem @*/;
00248 
00254     int (*byteswapped) (dbiIndex dbi)
00255         /*@globals fileSystem @*/
00256         /*@modifies fileSystem @*/;
00257 
00264     int (*stat) (dbiIndex dbi, unsigned int flags)
00265         /*@globals fileSystem @*/
00266         /*@modifies dbi, fileSystem @*/;
00267 };
00268 
00272 struct _dbiIndex {
00273 /*@null@*/
00274     const char * dbi_root;      
00275 /*@null@*/
00276     const char * dbi_home;      
00277 /*@relnull@*/
00278     const char * dbi_file;      
00279 /*@relnull@*/
00280     const char * dbi_subfile;
00281 /*@null@*/
00282     const char * dbi_tmpdir;    
00284     int dbi_ecflags;            
00285     int dbi_cflags;             
00286     int dbi_oeflags;            
00287     int dbi_eflags;             
00288     int dbi_oflags;             
00289     int dbi_tflags;             
00291     int dbi_type;               
00292     unsigned dbi_mode;          
00293     int dbi_perms;              
00294     long dbi_shmkey;            
00295     int dbi_api;                
00297     int dbi_verify_on_close;
00298     int dbi_use_dbenv;          
00299     int dbi_permit_dups;        
00300     int dbi_no_fsync;           
00301     int dbi_no_dbsync;          
00302     int dbi_lockdbfd;           
00303     int dbi_temporary;          
00304     int dbi_debug;
00305     int dbi_byteswapped;
00306 
00307 /*@null@*/
00308     char * dbi_host;
00309     unsigned long dbi_cl_timeout;
00310     unsigned long dbi_sv_timeout;
00311 
00312         /* dbenv parameters */
00313     int dbi_lorder;
00314 /*@unused@*/
00315     /* XXX db-4.3.14 adds dbenv as 1st arg. */
00316     void (*db_errcall) (void * dbenv, const char *db_errpfx, char *buffer)
00317         /*@globals fileSystem @*/
00318         /*@modifies fileSystem @*/;
00319 /*@unused@*/ /*@shared@*/
00320     FILE *      dbi_errfile;
00321     const char * dbi_errpfx;
00322     int dbi_verbose;
00323     int dbi_region_init;
00324     int dbi_tas_spins;
00325         /* mpool sub-system parameters */
00326     int dbi_mmapsize;   
00327     int dbi_cachesize;  
00328         /* lock sub-system parameters */
00329     unsigned int dbi_lk_max;
00330     unsigned int dbi_lk_detect;
00331 /*@unused@*/ int dbi_lk_nmodes;
00332 /*@unused@*/ unsigned char * dbi_lk_conflicts;
00333         /* log sub-system parameters */
00334     unsigned int dbi_lg_max;
00335     unsigned int dbi_lg_bsize;
00336         /* transaction sub-system parameters */
00337     unsigned int dbi_tx_max;
00338 #if 0
00339     int (*dbi_tx_recover) (DB_ENV *dbenv, DBT *log_rec,
00340                                 DB_LSN *lsnp, int redo, void *info)
00341         /*@globals fileSystem @*/
00342         /*@modifies fileSystem @*/;
00343 #endif
00344         /* dbinfo parameters */
00345     int dbi_pagesize;           
00346 /*@unused@*/ /*@null@*/
00347     void * (*dbi_malloc) (size_t nbytes)
00348         /*@*/;
00349         /* hash access parameters */
00350     unsigned int dbi_h_ffactor; 
00351     unsigned int (*dbi_h_hash_fcn) (DB *, const void *bytes,
00352                                 unsigned int length)
00353         /*@*/;
00354     unsigned int dbi_h_nelem;   
00355     unsigned int dbi_h_flags;   
00356     int (*dbi_h_dup_compare_fcn) (DB *, const DBT *, const DBT *)
00357         /*@*/;
00358         /* btree access parameters */
00359     int dbi_bt_flags;
00360     int dbi_bt_minkey;
00361     int (*dbi_bt_compare_fcn) (DB *, const DBT *, const DBT *)
00362         /*@*/;
00363     int (*dbi_bt_dup_compare_fcn) (DB *, const DBT *, const DBT *)
00364         /*@*/;
00365     size_t (*dbi_bt_prefix_fcn) (DB *, const DBT *, const DBT *)
00366         /*@*/;
00367         /* recno access parameters */
00368     int dbi_re_flags;
00369     int dbi_re_delim;
00370     unsigned int dbi_re_len;
00371     int dbi_re_pad;
00372     const char * dbi_re_source;
00373         /* queue access parameters */
00374     unsigned int dbi_q_extentsize;
00375 
00376 /*@refcounted@*/
00377     rpmdb dbi_rpmdb;            
00378     rpmTag dbi_rpmtag;          
00379     int dbi_jlen;               
00381 /*@only@*//*@null@*/
00382     DB * dbi_db;                
00383 /*@only@*//*@null@*/
00384     DB_TXN * dbi_txnid;         
00385 /*@only@*//*@null@*/
00386     void * dbi_stats;           
00388 /*@observer@*/
00389     const struct _dbiVec * dbi_vec;     
00391 };
00392 
00396 struct rpmdb_s {
00397 /*@owned@*/
00398     const char * db_root;
00399 /*@owned@*/
00400     const char * db_home;
00401     int         db_flags;
00402     int         db_mode;        
00403     int         db_perms;       
00404     int         db_api;         
00405 /*@owned@*/
00406     const char * db_errpfx;
00407     int         db_remove_env;
00408     int         db_filter_dups;
00409     int         db_chrootDone;  
00410     void (*db_errcall) (const char *db_errpfx, char *buffer)
00411         /*@*/;
00412 /*@shared@*/
00413     FILE *      db_errfile;
00414 /*@only@*/
00415     void * (*db_malloc) (size_t nbytes)
00416         /*@*/;
00417 /*@only@*/
00418     void * (*db_realloc) (/*@only@*//*@null@*/ void * ptr,
00419                                                 size_t nbytes)
00420         /*@*/;
00421     void (*db_free) (/*@only@*/ void * ptr)
00422         /*@modifies *ptr @*/;
00423 /*@only@*/ /*@null@*/
00424     unsigned char * db_bits;    
00425     int         db_nbits;       
00426     rpmdb       db_next;
00427     int         db_opens;
00428 /*@only@*/ /*@null@*/
00429     void *      db_dbenv;       
00430     int         db_ndbi;        
00431     dbiIndex * _dbi;            
00433     struct rpmop_s db_getops;
00434     struct rpmop_s db_putops;
00435     struct rpmop_s db_delops;
00436 
00437 /*@refs@*/
00438     int nrefs;                  
00439 };
00440 
00441 /* for RPM's internal use only */
00442 
00445 enum rpmdbFlags {
00446         RPMDB_FLAG_JUSTCHECK    = (1 << 0),
00447         RPMDB_FLAG_MINIMAL      = (1 << 1),
00448 /*@-enummemuse@*/
00449         RPMDB_FLAG_CHROOT       = (1 << 2)
00450 /*@=enummemuse@*/
00451 };
00452 
00453 #ifdef __cplusplus
00454 extern "C" {
00455 #endif
00456 
00457 /*@-exportlocal@*/
00464 /*@unused@*/ /*@only@*/ /*@null@*/
00465 dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag)
00466         /*@globals rpmGlobalMacroContext, h_errno @*/
00467         /*@modifies rpmGlobalMacroContext @*/;
00468 
00474 /*@null@*/
00475 dbiIndex db3Free( /*@only@*/ /*@null@*/ dbiIndex dbi)
00476         /*@*/;
00477 
00484 /*@-redecl@*/
00485 /*@exposed@*/
00486 extern const char *const prDbiOpenFlags(int dbflags, int print_dbenv_flags)
00487         /*@*/;
00488 /*@=redecl@*/
00489 
00497 /*@only@*/ /*@null@*/ dbiIndex dbiOpen(/*@null@*/ rpmdb db, rpmTag rpmtag,
00498                 unsigned int flags)
00499         /*@globals rpmGlobalMacroContext, errno, h_errno @*/
00500         /*@modifies db, rpmGlobalMacroContext, errno @*/;
00501 
00502 /*@-globuse -mustmod @*/ /* FIX: vector annotations */
00511 /*@unused@*/ static inline
00512 int dbiCopen(dbiIndex dbi, /*@null@*/ DB_TXN * txnid,
00513                 /*@out@*/ DBC ** dbcp, unsigned int flags)
00514         /*@globals fileSystem @*/
00515         /*@modifies dbi, *dbcp, fileSystem @*/
00516 {
00517     return (*dbi->dbi_vec->copen) (dbi, txnid, dbcp, flags);
00518 }
00519 
00527 /*@unused@*/ static inline
00528 int dbiCclose(dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags)
00529         /*@globals fileSystem @*/
00530         /*@modifies dbi, *dbcursor, fileSystem @*/
00531 {
00532     return (*dbi->dbi_vec->cclose) (dbi, dbcursor, flags);
00533 }
00534 
00543 /*@unused@*/ static inline
00544 int dbiCdup(dbiIndex dbi, DBC * dbcursor, /*@out@*/ DBC ** dbcp,
00545                 unsigned int flags)
00546         /*@modifies dbi, *dbcp @*/
00547 {
00548     return (*dbi->dbi_vec->cdup) (dbi, dbcursor, dbcp, flags);
00549 }
00550 
00560 /*@unused@*/ static inline
00561 int dbiDel(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
00562                 unsigned int flags)
00563         /*@globals fileSystem, internalState @*/
00564         /*@modifies dbi, *dbcursor, fileSystem, internalState @*/
00565 {
00566     int rc;
00567     assert(key->data != NULL && key->size > 0);
00568     (void) rpmswEnter(&dbi->dbi_rpmdb->db_delops, 0);
00569     rc = (dbi->dbi_vec->cdel) (dbi, dbcursor, key, data, flags);
00570     (void) rpmswExit(&dbi->dbi_rpmdb->db_delops, data->size);
00571     return rc;
00572 }
00573 
00583 /*@unused@*/ static inline
00584 int dbiGet(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
00585                 unsigned int flags)
00586         /*@globals fileSystem, internalState @*/
00587         /*@modifies dbi, *dbcursor, *key, *data, fileSystem, internalState @*/
00588 {
00589     int rc;
00590     assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0));
00591     (void) rpmswEnter(&dbi->dbi_rpmdb->db_getops, 0);
00592     rc = (dbi->dbi_vec->cget) (dbi, dbcursor, key, data, flags);
00593     (void) rpmswExit(&dbi->dbi_rpmdb->db_getops, data->size);
00594     return rc;
00595 }
00596 
00607 /*@unused@*/ static inline
00608 int dbiPget(dbiIndex dbi, /*@null@*/ DBC * dbcursor,
00609                 DBT * key, DBT * pkey, DBT * data, unsigned int flags)
00610         /*@globals fileSystem, internalState @*/
00611         /*@modifies dbi, *dbcursor, *key, *pkey, *data, fileSystem, internalState @*/
00612 {
00613     int rc;
00614     assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0));
00615     (void) rpmswEnter(&dbi->dbi_rpmdb->db_getops, 0);
00616     rc = (dbi->dbi_vec->cpget) (dbi, dbcursor, key, pkey, data, flags);
00617     (void) rpmswExit(&dbi->dbi_rpmdb->db_getops, data->size);
00618     return rc;
00619 }
00620 
00630 /*@unused@*/ static inline
00631 int dbiPut(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
00632                 unsigned int flags)
00633         /*@globals fileSystem, internalState @*/
00634         /*@modifies dbi, *dbcursor, *key, fileSystem, internalState @*/
00635 {
00636     int rc;
00637     assert(key->data != NULL && key->size > 0 && data->data != NULL && data->size > 0);
00638     (void) rpmswEnter(&dbi->dbi_rpmdb->db_putops, 0);
00639     rc = (dbi->dbi_vec->cput) (dbi, dbcursor, key, data, flags);
00640     (void) rpmswExit(&dbi->dbi_rpmdb->db_putops, data->size);
00641     return rc;
00642 }
00643 
00652 /*@unused@*/ static inline
00653 int dbiCount(dbiIndex dbi, DBC * dbcursor, /*@out@*/ unsigned int * countp,
00654                 unsigned int flags)
00655         /*@globals fileSystem @*/
00656         /*@modifies *dbcursor, fileSystem @*/
00657 {
00658     return (*dbi->dbi_vec->ccount) (dbi, dbcursor, countp, flags);
00659 }
00660 
00667 /*@unused@*/ static inline
00668 int dbiVerify(/*@only@*/ dbiIndex dbi, unsigned int flags)
00669         /*@globals fileSystem @*/
00670         /*@modifies dbi, fileSystem @*/
00671 {
00672     dbi->dbi_verify_on_close = 1;
00673     return (*dbi->dbi_vec->close) (dbi, flags);
00674 }
00675 
00682 /*@unused@*/ static inline
00683 int dbiClose(/*@only@*/ dbiIndex dbi, unsigned int flags)
00684         /*@globals fileSystem @*/
00685         /*@modifies dbi, fileSystem @*/
00686 {
00687     return (*dbi->dbi_vec->close) (dbi, flags);
00688 }
00689 
00696 /*@unused@*/ static inline
00697 int dbiSync (dbiIndex dbi, unsigned int flags)
00698         /*@globals fileSystem @*/
00699         /*@modifies fileSystem @*/
00700 {
00701     return (*dbi->dbi_vec->sync) (dbi, flags);
00702 }
00703 
00712 /*@unused@*/ static inline
00713 int dbiAssociate(dbiIndex dbi, dbiIndex dbisecondary,
00714                 int (*callback) (DB *, const DBT *, const DBT *, DBT *),
00715                 unsigned int flags)
00716         /*@globals fileSystem @*/
00717         /*@modifies dbi, fileSystem @*/
00718 {
00719     return (*dbi->dbi_vec->associate) (dbi, dbisecondary, callback, flags);
00720 }
00721 
00730 /*@unused@*/ static inline
00731 int dbiJoin(dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp,
00732                 unsigned int flags)
00733         /*@globals fileSystem @*/
00734         /*@modifies dbi, *dbcp, fileSystem @*/
00735 {
00736     return (*dbi->dbi_vec->join) (dbi, curslist, dbcp, flags);
00737 }
00738 
00744 /*@unused@*/ static inline
00745 int dbiByteSwapped(dbiIndex dbi)
00746         /*@modifies dbi @*/
00747 {
00748     if (dbi->dbi_byteswapped == -1)
00749         dbi->dbi_byteswapped = (*dbi->dbi_vec->byteswapped) (dbi);
00750     return dbi->dbi_byteswapped;
00751 }
00758 /*@unused@*/ static inline
00759 int dbiStat(dbiIndex dbi, unsigned int flags)
00760         /*@modifies dbi @*/
00761 {
00762     return (*dbi->dbi_vec->stat) (dbi, flags);
00763 }
00764 /*@=globuse =mustmod @*/
00765 
00766 /*@=exportlocal@*/
00767 
00770 unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi)
00771         /*@*/;
00772 
00778 /*@null@*/ dbiIndexSet dbiFreeIndexSet(/*@only@*/ /*@null@*/ dbiIndexSet set)
00779         /*@modifies set @*/;
00780 
00786 unsigned int dbiIndexSetCount(dbiIndexSet set)
00787         /*@*/;
00788 
00795 unsigned int dbiIndexRecordOffset(dbiIndexSet set, int recno)
00796         /*@*/;
00797 
00804 unsigned int dbiIndexRecordFileNumber(dbiIndexSet set, int recno)
00805         /*@*/;
00806 
00810 /*@-exportlocal@*/
00811 /*@unchecked@*/
00812 /*@only@*/ /*@null@*/ extern int * dbiTags;
00813 /*@unchecked@*/
00814 extern int dbiTagsMax;
00815 /*@=exportlocal@*/
00816 
00823 /*@unused@*/ /*@null@*/
00824 rpmdb rpmdbUnlink (/*@killref@*/ /*@only@*/ rpmdb db, const char * msg)
00825         /*@modifies db @*/;
00826 
00828 /*@-exportlocal@*/
00829 /*@null@*/
00830 rpmdb XrpmdbUnlink (/*@killref@*/ /*@only@*/ rpmdb db, const char * msg,
00831                 const char * fn, unsigned ln)
00832         /*@modifies db @*/;
00833 /*@=exportlocal@*/
00834 #define rpmdbUnlink(_db, _msg)  XrpmdbUnlink(_db, _msg, __FILE__, __LINE__)
00835 
00842 /*@unused@*/
00843 rpmdb rpmdbLink (rpmdb db, const char * msg)
00844         /*@modifies db @*/;
00845 
00847 /*@-exportlocal@*/
00848 rpmdb XrpmdbLink (rpmdb db, const char * msg,
00849                 const char * fn, unsigned ln)
00850         /*@modifies db @*/;
00851 /*@=exportlocal@*/
00852 #define rpmdbLink(_db, _msg)    XrpmdbLink(_db, _msg, __FILE__, __LINE__)
00853 
00862 int rpmdbOpen (/*@null@*/ const char * prefix, /*@null@*/ /*@out@*/ rpmdb * dbp,
00863                 int mode, int perms)
00864         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00865         /*@modifies *dbp, rpmGlobalMacroContext, fileSystem, internalState @*/;
00866 
00873 int rpmdbInit(/*@null@*/ const char * prefix, int perms)
00874         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00875         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
00876 
00882 int rpmdbVerify(/*@null@*/ const char * prefix)
00883         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00884         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
00885 
00892 int rpmdbCloseDBI(/*@null@*/ rpmdb db, int rpmtag)
00893         /*@globals fileSystem @*/
00894         /*@modifies db, fileSystem @*/;
00895 
00901 int rpmdbClose (/*@killref@*/ /*@only@*/ /*@null@*/ rpmdb db)
00902         /*@globals fileSystem @*/
00903         /*@modifies db, fileSystem @*/;
00904 
00910 int rpmdbSync (/*@null@*/ rpmdb db)
00911         /*@globals fileSystem @*/
00912         /*@modifies fileSystem @*/;
00913 
00919 /*@-exportlocal@*/
00920 int rpmdbOpenAll (/*@null@*/ rpmdb db)
00921         /*@globals rpmGlobalMacroContext, h_errno @*/
00922         /*@modifies db, rpmGlobalMacroContext @*/;
00923 /*@=exportlocal@*/
00924 
00931 int rpmdbCountPackages(/*@null@*/ rpmdb db, const char * name)
00932         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
00933         /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
00934 
00940 unsigned int rpmdbGetIteratorOffset(/*@null@*/ rpmdbMatchIterator mi)
00941         /*@*/;
00942 
00948 int rpmdbGetIteratorCount(/*@null@*/ rpmdbMatchIterator mi)
00949         /*@*/;
00950 
00958 int rpmdbAppendIterator(/*@null@*/ rpmdbMatchIterator mi,
00959                 /*@null@*/ const int * hdrNums, int nHdrNums)
00960         /*@modifies mi @*/;
00961 
00971 int rpmdbPruneIterator(/*@null@*/ rpmdbMatchIterator mi,
00972                 /*@null@*/ int * hdrNums, int nHdrNums, int sorted)
00973         /*@modifies mi, hdrNums @*/;
00974 
00983 int rpmdbSetIteratorRE(/*@null@*/ rpmdbMatchIterator mi, rpmTag tag,
00984                 rpmMireMode mode, /*@null@*/ const char * pattern)
00985         /*@globals rpmGlobalMacroContext, h_errno @*/
00986         /*@modifies mi, mode, rpmGlobalMacroContext @*/;
00987 
00995 int rpmdbSetIteratorRewrite(/*@null@*/ rpmdbMatchIterator mi, int rewrite)
00996         /*@modifies mi @*/;
00997 
01004 int rpmdbSetIteratorModified(/*@null@*/ rpmdbMatchIterator mi, int modified)
01005         /*@modifies mi @*/;
01006 
01014 int rpmdbSetHdrChk(/*@null@*/ rpmdbMatchIterator mi, /*@null@*/ rpmts ts,
01015                 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void * uh, size_t uc, const char ** msg))
01016         /*@modifies mi @*/;
01017 
01026 /*@only@*/ /*@null@*/
01027 rpmdbMatchIterator rpmdbInitIterator(/*@null@*/ rpmdb db, rpmTag rpmtag,
01028                         /*@null@*/ const void * keyp, size_t keylen)
01029         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
01030         /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
01031 
01037 /*@null@*/
01038 Header rpmdbNextIterator(/*@null@*/ rpmdbMatchIterator mi)
01039         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
01040         /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
01041 
01045 /*@mayexit@*/
01046 int rpmdbCheckSignals(void)
01047         /*@globals fileSystem, internalState @*/
01048         /*@modifies fileSystem, internalState @*/;
01049 
01058 int rpmdbCheckTerminate(int terminate);
01059 
01065 /*@null@*/
01066 rpmdbMatchIterator rpmdbFreeIterator(/*@only@*/ /*@null@*/rpmdbMatchIterator mi)
01067         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
01068         /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
01069 
01079 int rpmdbAdd(/*@null@*/ rpmdb db, int iid, Header h, /*@null@*/ rpmts ts,
01080                 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg))
01081         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
01082         /*@modifies db, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
01083 
01093 int rpmdbRemove(/*@null@*/ rpmdb db, /*@unused@*/ int rid, unsigned int hdrNum,
01094                 /*@null@*/ rpmts ts,
01095                 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg))
01096         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
01097         /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
01098 
01106 int rpmdbRebuild(/*@null@*/ const char * prefix, /*@null@*/ rpmts ts,
01107                 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg))
01108         /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
01109         /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
01110 
01111 #ifndef __APPLE__
01112 
01115 /*@unused@*/
01116 int mergesort(void *base, size_t nmemb, size_t size,
01117                 int (*cmp) (const void *, const void *))
01118         /*@globals errno @*/
01119         /*@modifies base, errno @*/;
01120 #else
01121 /* mergesort is defined in stdlib.h on Mac OS X */
01122 #endif /* __APPLE__ */
01123 
01124 #ifdef __cplusplus
01125 }
01126 #endif
01127 
01128 /*@=bounds@*/
01129 #endif  /* H_RPMDB */

Generated on Thu Feb 23 13:26:15 2012 for rpm by  doxygen 1.4.7