rpm
4.5
|
00001 #ifndef H_RPMDB 00002 #define H_RPMDB 00003 /*@-bounds@*/ 00004 00010 #include <assert.h> 00011 #include <rpmlib.h> 00012 #include <mire.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 00034 typedef /*@abstract@*/ struct _dbiIndexItem * dbiIndexItem; 00035 00039 typedef /*@abstract@*/ struct _dbiIndexSet * dbiIndexSet; 00040 00043 typedef /*@abstract@*/ struct _dbiIndex * dbiIndex; 00044 00045 #if defined(_RPMDB_INTERNAL) 00046 #include "rpmsw.h" 00047 #if !defined(SWIG) /* XXX inline dbiFoo() need */ 00048 00053 struct _dbiIndexItem { 00054 unsigned int hdrNum; 00055 unsigned int tagNum; 00056 unsigned int fpNum; 00057 }; 00058 00062 struct _dbiIndexSet { 00063 /*@owned@*/ struct _dbiIndexItem * recs; 00064 int count; 00065 }; 00066 00070 struct _dbiVec { 00071 int dbv_major; 00072 int dbv_minor; 00073 int dbv_patch; 00081 int (*open) (rpmdb rpmdb, rpmTag rpmtag, /*@out@*/ dbiIndex * dbip) 00082 /*@globals fileSystem @*/ 00083 /*@modifies *dbip, fileSystem @*/; 00084 00091 int (*close) (/*@only@*/ dbiIndex dbi, unsigned int flags) 00092 /*@globals fileSystem @*/ 00093 /*@modifies dbi, fileSystem @*/; 00094 00101 int (*sync) (dbiIndex dbi, unsigned int flags) 00102 /*@globals fileSystem @*/ 00103 /*@modifies fileSystem @*/; 00104 00113 int (*associate) (dbiIndex dbi, dbiIndex dbisecondary, 00114 int (*callback) (DB *, const DBT *, const DBT *, DBT *), 00115 unsigned int flags) 00116 /*@globals fileSystem @*/ 00117 /*@modifies dbi, fileSystem @*/; 00118 00127 int (*join) (dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp, 00128 unsigned int flags) 00129 /*@globals fileSystem @*/ 00130 /*@modifies dbi, *dbcp, fileSystem @*/; 00131 00140 int (*copen) (dbiIndex dbi, /*@null@*/ DB_TXN * txnid, 00141 /*@out@*/ DBC ** dbcp, unsigned int dbiflags) 00142 /*@globals fileSystem @*/ 00143 /*@modifies dbi, *txnid, *dbcp, fileSystem @*/; 00144 00152 int (*cclose) (dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags) 00153 /*@globals fileSystem @*/ 00154 /*@modifies dbi, *dbcursor, fileSystem @*/; 00155 00164 int (*cdup) (dbiIndex dbi, DBC * dbcursor, /*@out@*/ DBC ** dbcp, 00165 unsigned int flags) 00166 /*@globals fileSystem @*/ 00167 /*@modifies dbi, *dbcp, fileSystem @*/; 00168 00178 int (*cdel) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data, 00179 unsigned int flags) 00180 /*@globals fileSystem @*/ 00181 /*@modifies *dbcursor, fileSystem @*/; 00182 00192 int (*cget) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data, 00193 unsigned int flags) 00194 /*@globals fileSystem @*/ 00195 /*@modifies *dbcursor, *key, *data, fileSystem @*/; 00196 00207 int (*cpget) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, 00208 DBT * key, DBT * pkey, DBT * data, unsigned int flags) 00209 /*@globals fileSystem @*/ 00210 /*@modifies *dbcursor, *key, *pkey, *data, fileSystem @*/; 00211 00221 int (*cput) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data, 00222 unsigned int flags) 00223 /*@globals fileSystem @*/ 00224 /*@modifies *dbcursor, fileSystem @*/; 00225 00234 int (*ccount) (dbiIndex dbi, DBC * dbcursor, 00235 /*@out@*/ unsigned int * countp, 00236 unsigned int flags) 00237 /*@globals fileSystem @*/ 00238 /*@modifies *dbcursor, fileSystem @*/; 00239 00245 int (*byteswapped) (dbiIndex dbi) 00246 /*@globals fileSystem @*/ 00247 /*@modifies fileSystem @*/; 00248 00255 int (*stat) (dbiIndex dbi, unsigned int flags) 00256 /*@globals fileSystem @*/ 00257 /*@modifies dbi, fileSystem @*/; 00258 }; 00259 00263 struct _dbiIndex { 00264 /*@relnull@*/ 00265 const char * dbi_root; 00266 /*@null@*/ 00267 const char * dbi_home; 00268 /*@relnull@*/ 00269 const char * dbi_file; 00270 /*@relnull@*/ 00271 const char * dbi_subfile; 00272 /*@null@*/ 00273 const char * dbi_tmpdir; 00275 int dbi_ecflags; 00276 int dbi_cflags; 00277 int dbi_oeflags; 00278 int dbi_eflags; 00279 int dbi_oflags; 00280 int dbi_tflags; 00282 int dbi_type; 00283 unsigned dbi_mode; 00284 int dbi_perms; 00285 long dbi_shmkey; 00286 int dbi_api; 00288 int dbi_verify_on_close; 00289 int dbi_use_dbenv; 00290 int dbi_permit_dups; 00291 int dbi_no_fsync; 00292 int dbi_no_dbsync; 00293 int dbi_lockdbfd; 00294 int dbi_temporary; 00295 int dbi_debug; 00296 int dbi_byteswapped; 00297 00298 /*@null@*/ 00299 char * dbi_host; 00300 unsigned long dbi_cl_timeout; 00301 unsigned long dbi_sv_timeout; 00302 00303 /* dbenv parameters */ 00304 int dbi_lorder; 00305 /*@unused@*/ 00306 /* XXX db-4.3.14 adds dbenv as 1st arg. */ 00307 void (*db_errcall) (void * dbenv, const char *db_errpfx, char *buffer) 00308 /*@globals fileSystem @*/ 00309 /*@modifies fileSystem @*/; 00310 /*@unused@*/ /*@shared@*/ 00311 FILE * dbi_errfile; 00312 const char * dbi_errpfx; 00313 int dbi_verbose; 00314 int dbi_region_init; 00315 unsigned int dbi_thread_count; 00316 /* locking sub-system parameters */ 00317 unsigned int dbi_lk_max_lockers; 00318 unsigned int dbi_lk_max_locks; 00319 unsigned int dbi_lk_max_objects; 00320 unsigned int dbi_lk_detect; 00321 /*@unused@*/ 00322 int dbi_lk_nmodes; 00323 /*@unused@*/ 00324 unsigned char * dbi_lk_conflicts; 00325 /* logging sub-system parameters */ 00326 unsigned int dbi_lg_bsize; 00327 /*@unused@*/ 00328 const char * dbi_lg_dir; 00329 /*@unused@*/ 00330 unsigned int dbi_lg_filemode; 00331 unsigned int dbi_lg_max; 00332 unsigned int dbi_lg_regionmax; 00333 /* mpool sub-system parameters */ 00334 int dbi_mmapsize; 00335 int dbi_cachesize; 00336 /* mutex sub-system parameters */ 00337 unsigned int dbi_mutex_align; 00338 unsigned int dbi_mutex_increment; 00339 unsigned int dbi_mutex_max; 00340 unsigned int dbi_mutex_tas_spins; 00341 /* replication sub-system parameters */ 00342 /* sequences sub-system parameters */ 00343 unsigned int dbi_seq_cachesize; 00344 unsigned int dbi_seq_flags; 00345 #if 0 /* needs signed 64 bit type */ 00346 int64_t dbi_seq_min; 00347 int64_t dbi_seq_max; 00348 #endif 00349 /* transaction sub-system parameters */ 00350 unsigned int dbi_tx_max; 00351 #if 0 00352 int (*dbi_tx_recover) (DB_ENV *dbenv, DBT *log_rec, 00353 DB_LSN *lsnp, int redo, void *info) 00354 /*@globals fileSystem @*/ 00355 /*@modifies fileSystem @*/; 00356 #endif 00357 /* dbinfo parameters */ 00358 int dbi_pagesize; 00359 /*@unused@*/ /*@null@*/ 00360 void * (*dbi_malloc) (size_t nbytes) 00361 /*@*/; 00362 /* hash access parameters */ 00363 unsigned int dbi_h_ffactor; 00364 unsigned int (*dbi_h_hash_fcn) (DB *, const void *bytes, 00365 unsigned int length) 00366 /*@*/; 00367 unsigned int dbi_h_nelem; 00368 unsigned int dbi_h_flags; 00369 int (*dbi_h_dup_compare_fcn) (DB *, const DBT *, const DBT *) 00370 /*@*/; 00371 /* btree access parameters */ 00372 int dbi_bt_flags; 00373 int dbi_bt_minkey; 00374 int (*dbi_bt_compare_fcn) (DB *, const DBT *, const DBT *) 00375 /*@*/; 00376 int (*dbi_bt_dup_compare_fcn) (DB *, const DBT *, const DBT *) 00377 /*@*/; 00378 size_t (*dbi_bt_prefix_fcn) (DB *, const DBT *, const DBT *) 00379 /*@*/; 00380 /* recno access parameters */ 00381 int dbi_re_flags; 00382 int dbi_re_delim; 00383 unsigned int dbi_re_len; 00384 int dbi_re_pad; 00385 const char * dbi_re_source; 00386 /* queue access parameters */ 00387 unsigned int dbi_q_extentsize; 00388 00389 /*@refcounted@*/ 00390 rpmdb dbi_rpmdb; 00391 rpmTag dbi_rpmtag; 00392 int dbi_jlen; 00394 /*@only@*//*@relnull@*/ 00395 DB * dbi_db; 00396 /*@only@*//*@null@*/ 00397 DB_TXN * dbi_txnid; 00398 /*@only@*//*@null@*/ 00399 void * dbi_stats; 00401 /*@observer@*/ 00402 const struct _dbiVec * dbi_vec; 00404 }; 00405 #endif /* !defined(SWIG) */ 00406 00410 struct rpmdb_s { 00411 /*@owned@*/ /*@relnull@*/ 00412 const char * db_root; 00413 /*@owned@*/ 00414 const char * db_home; 00415 int db_flags; 00416 int db_mode; 00417 int db_perms; 00418 int db_api; 00419 /*@owned@*/ 00420 const char * db_errpfx; 00422 int db_remove_env; 00423 int db_filter_dups; 00424 int db_verifying; 00425 00426 int db_chrootDone; 00427 void (*db_errcall) (const char * db_errpfx, char * buffer) 00428 /*@*/; 00429 /*@shared@*/ 00430 FILE * db_errfile; 00431 /*@only@*/ 00432 void * (*db_malloc) (size_t nbytes) 00433 /*@*/; 00434 /*@only@*/ 00435 void * (*db_realloc) (/*@only@*//*@null@*/ void * ptr, size_t nbytes) 00436 /*@*/; 00437 void (*db_free) (/*@only@*/ void * ptr) 00438 /*@modifies *ptr @*/; 00439 00440 int (*db_export) (rpmdb db, Header h, int adding); 00441 00442 /*@only@*/ /*@null@*/ 00443 unsigned char * db_bits; 00444 int db_nbits; 00445 rpmdb db_next; 00446 int db_opens; 00447 /*@only@*/ /*@null@*/ 00448 void * db_dbenv; 00449 int * db_tagn; 00450 int db_ndbi; 00451 /*@only@*/ /*@null@*/ 00452 dbiIndex * _dbi; 00454 struct rpmop_s db_getops; 00455 struct rpmop_s db_putops; 00456 struct rpmop_s db_delops; 00458 /*@refs@*/ 00459 int nrefs; 00460 }; 00461 #endif /* defined(_RPMDB_INTERNAL) */ 00462 00463 /* for RPM's internal use only */ 00464 00467 enum rpmdbFlags { 00468 RPMDB_FLAG_JUSTCHECK = (1 << 0), 00469 RPMDB_FLAG_MINIMAL = (1 << 1), 00470 /*@-enummemuse@*/ 00471 RPMDB_FLAG_CHROOT = (1 << 2) 00472 /*@=enummemuse@*/ 00473 }; 00474 00475 #ifdef __cplusplus 00476 extern "C" { 00477 #endif 00478 00479 #if defined(_RPMDB_INTERNAL) 00480 /*@-exportlocal@*/ 00487 /*@unused@*/ /*@only@*/ /*@null@*/ 00488 dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag) 00489 /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ 00490 /*@modifies rpmGlobalMacroContext, internalState @*/; 00491 00497 /*@null@*/ 00498 dbiIndex db3Free( /*@only@*/ /*@null@*/ dbiIndex dbi) 00499 /*@*/; 00500 00507 /*@-redecl@*/ 00508 /*@exposed@*/ 00509 extern const char * prDbiOpenFlags(int dbflags, int print_dbenv_flags) 00510 /*@*/; 00511 /*@=redecl@*/ 00512 00520 /*@only@*/ /*@null@*/ dbiIndex dbiOpen(/*@null@*/ rpmdb db, rpmTag rpmtag, 00521 unsigned int flags) 00522 /*@globals rpmGlobalMacroContext, errno, h_errno @*/ 00523 /*@modifies db, rpmGlobalMacroContext, errno @*/; 00524 00531 void * dbiStatsAccumulator(dbiIndex dbi, int opx) 00532 /*@*/; 00533 00534 #if !defined(SWIG) 00535 /*@-globuse -mustmod @*/ /* FIX: vector annotations */ 00544 /*@unused@*/ static inline 00545 int dbiCopen(dbiIndex dbi, /*@null@*/ DB_TXN * txnid, 00546 /*@out@*/ DBC ** dbcp, unsigned int flags) 00547 /*@globals fileSystem @*/ 00548 /*@modifies dbi, *dbcp, fileSystem @*/ 00549 { 00550 return (*dbi->dbi_vec->copen) (dbi, txnid, dbcp, flags); 00551 } 00552 00560 /*@unused@*/ static inline 00561 int dbiCclose(dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags) 00562 /*@globals fileSystem @*/ 00563 /*@modifies dbi, *dbcursor, fileSystem @*/ 00564 { 00565 return (*dbi->dbi_vec->cclose) (dbi, dbcursor, flags); 00566 } 00567 00576 /*@unused@*/ static inline 00577 int dbiCdup(dbiIndex dbi, DBC * dbcursor, /*@out@*/ DBC ** dbcp, 00578 unsigned int flags) 00579 /*@modifies dbi, *dbcp @*/ 00580 { 00581 return (*dbi->dbi_vec->cdup) (dbi, dbcursor, dbcp, flags); 00582 } 00583 00593 /*@unused@*/ static inline 00594 int dbiDel(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data, 00595 unsigned int flags) 00596 /*@globals fileSystem, internalState @*/ 00597 /*@modifies dbi, *dbcursor, fileSystem, internalState @*/ 00598 { 00599 rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 16); /* RPMTS_OP_DBDEL */ 00600 int rc; 00601 assert(key->data != NULL && key->size > 0); 00602 (void) rpmswEnter(sw, 0); 00603 rc = (dbi->dbi_vec->cdel) (dbi, dbcursor, key, data, flags); 00604 (void) rpmswExit(sw, data->size); 00605 return rc; 00606 } 00607 00617 /*@unused@*/ static inline 00618 int dbiGet(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data, 00619 unsigned int flags) 00620 /*@globals fileSystem, internalState @*/ 00621 /*@modifies dbi, *dbcursor, *key, *data, fileSystem, internalState @*/ 00622 { 00623 rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 14); /* RPMTS_OP_DBGET */ 00624 int rc; 00625 assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0)); 00626 (void) rpmswEnter(sw, 0); 00627 rc = (dbi->dbi_vec->cget) (dbi, dbcursor, key, data, flags); 00628 (void) rpmswExit(sw, data->size); 00629 return rc; 00630 } 00631 00642 /*@unused@*/ static inline 00643 int dbiPget(dbiIndex dbi, /*@null@*/ DBC * dbcursor, 00644 DBT * key, DBT * pkey, DBT * data, unsigned int flags) 00645 /*@globals fileSystem, internalState @*/ 00646 /*@modifies dbi, *dbcursor, *key, *pkey, *data, fileSystem, internalState @*/ 00647 { 00648 rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 14); /* RPMTS_OP_DBGET */ 00649 int rc; 00650 assert((flags == DB_NEXT) || (key->data != NULL && key->size > 0)); 00651 (void) rpmswEnter(sw, 0); 00652 rc = (dbi->dbi_vec->cpget) (dbi, dbcursor, key, pkey, data, flags); 00653 (void) rpmswExit(sw, data->size); 00654 return rc; 00655 } 00656 00666 /*@unused@*/ static inline 00667 int dbiPut(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data, 00668 unsigned int flags) 00669 /*@globals fileSystem, internalState @*/ 00670 /*@modifies dbi, *dbcursor, *key, fileSystem, internalState @*/ 00671 { 00672 rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 15); /* RPMTS_OP_DBPUT */ 00673 int rc; 00674 assert(key->data != NULL && key->size > 0 && data->data != NULL && data->size > 0); 00675 (void) rpmswEnter(sw, 0); 00676 rc = (dbi->dbi_vec->cput) (dbi, dbcursor, key, data, flags); 00677 (void) rpmswExit(sw, data->size); 00678 return rc; 00679 } 00680 00689 /*@unused@*/ static inline 00690 int dbiCount(dbiIndex dbi, DBC * dbcursor, /*@out@*/ unsigned int * countp, 00691 unsigned int flags) 00692 /*@globals fileSystem @*/ 00693 /*@modifies *dbcursor, fileSystem @*/ 00694 { 00695 return (*dbi->dbi_vec->ccount) (dbi, dbcursor, countp, flags); 00696 } 00697 00704 /*@unused@*/ static inline 00705 int dbiVerify(/*@only@*/ dbiIndex dbi, unsigned int flags) 00706 /*@globals fileSystem @*/ 00707 /*@modifies dbi, fileSystem @*/ 00708 { 00709 dbi->dbi_verify_on_close = 1; 00710 return (*dbi->dbi_vec->close) (dbi, flags); 00711 } 00712 00719 /*@unused@*/ static inline 00720 int dbiClose(/*@only@*/ dbiIndex dbi, unsigned int flags) 00721 /*@globals fileSystem @*/ 00722 /*@modifies dbi, fileSystem @*/ 00723 { 00724 return (*dbi->dbi_vec->close) (dbi, flags); 00725 } 00726 00733 /*@unused@*/ static inline 00734 int dbiSync (dbiIndex dbi, unsigned int flags) 00735 /*@globals fileSystem @*/ 00736 /*@modifies fileSystem @*/ 00737 { 00738 return (*dbi->dbi_vec->sync) (dbi, flags); 00739 } 00740 00749 /*@unused@*/ static inline 00750 int dbiAssociate(dbiIndex dbi, dbiIndex dbisecondary, 00751 int (*callback) (DB *, const DBT *, const DBT *, DBT *), 00752 unsigned int flags) 00753 /*@globals fileSystem @*/ 00754 /*@modifies dbi, fileSystem @*/ 00755 { 00756 return (*dbi->dbi_vec->associate) (dbi, dbisecondary, callback, flags); 00757 } 00758 00767 /*@unused@*/ static inline 00768 int dbiJoin(dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp, 00769 unsigned int flags) 00770 /*@globals fileSystem @*/ 00771 /*@modifies dbi, *dbcp, fileSystem @*/ 00772 { 00773 return (*dbi->dbi_vec->join) (dbi, curslist, dbcp, flags); 00774 } 00775 00781 /*@unused@*/ static inline 00782 int dbiByteSwapped(dbiIndex dbi) 00783 /*@modifies dbi @*/ 00784 { 00785 if (dbi->dbi_byteswapped == -1) 00786 dbi->dbi_byteswapped = (*dbi->dbi_vec->byteswapped) (dbi); 00787 return dbi->dbi_byteswapped; 00788 } 00789 00796 /*@unused@*/ static inline 00797 int dbiStat(dbiIndex dbi, unsigned int flags) 00798 /*@modifies dbi @*/ 00799 { 00800 return (*dbi->dbi_vec->stat) (dbi, flags); 00801 } 00802 00808 /*@unused@*/ static inline /*@observer@*/ /*@null@*/ 00809 DB_TXN * dbiTxnid(dbiIndex dbi) 00810 /*@*/ 00811 { 00812 return dbi->dbi_txnid; 00813 } 00814 /*@=globuse =mustmod @*/ 00815 #endif /* !defined(SWIG) */ 00816 00817 /*@=exportlocal@*/ 00818 00821 unsigned int rpmdbGetIteratorFileNum(rpmdbMatchIterator mi) 00822 /*@*/; 00823 00829 /*@null@*/ 00830 dbiIndexSet dbiFreeIndexSet(/*@only@*/ /*@null@*/ dbiIndexSet set) 00831 /*@modifies set @*/; 00832 00838 unsigned int dbiIndexSetCount(dbiIndexSet set) 00839 /*@*/; 00840 00847 unsigned int dbiIndexRecordOffset(dbiIndexSet set, int recno) 00848 /*@*/; 00849 00856 unsigned int dbiIndexRecordFileNumber(dbiIndexSet set, int recno) 00857 /*@*/; 00858 #endif /* defined(_RPMDB_INTERNAL) */ 00859 00866 /*@unused@*/ /*@null@*/ 00867 rpmdb rpmdbUnlink (/*@killref@*/ /*@only@*/ rpmdb db, const char * msg) 00868 /*@modifies db @*/; 00869 00871 /*@-exportlocal@*/ 00872 /*@null@*/ 00873 rpmdb XrpmdbUnlink (/*@killref@*/ /*@only@*/ rpmdb db, const char * msg, 00874 const char * fn, unsigned ln) 00875 /*@modifies db @*/; 00876 /*@=exportlocal@*/ 00877 #define rpmdbUnlink(_db, _msg) XrpmdbUnlink(_db, _msg, __FILE__, __LINE__) 00878 00885 /*@unused@*/ 00886 rpmdb rpmdbLink (rpmdb db, const char * msg) 00887 /*@modifies db @*/; 00888 00890 /*@-exportlocal@*/ 00891 rpmdb XrpmdbLink (rpmdb db, const char * msg, 00892 const char * fn, unsigned ln) 00893 /*@modifies db @*/; 00894 /*@=exportlocal@*/ 00895 #define rpmdbLink(_db, _msg) XrpmdbLink(_db, _msg, __FILE__, __LINE__) 00896 00905 int rpmdbOpen (/*@null@*/ const char * prefix, /*@null@*/ /*@out@*/ rpmdb * dbp, 00906 int mode, int perms) 00907 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 00908 /*@modifies *dbp, rpmGlobalMacroContext, fileSystem, internalState @*/; 00909 00916 int rpmdbInit(/*@null@*/ const char * prefix, int perms) 00917 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 00918 /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; 00919 00925 int rpmdbVerifyAllDBI(rpmdb db) 00926 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 00927 /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/; 00928 00934 int rpmdbVerify(/*@null@*/ const char * prefix) 00935 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 00936 /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; 00937 00944 int rpmdbBlockDBI(/*@null@*/ rpmdb db, int rpmtag) 00945 /*@modifies db @*/; 00946 00953 int rpmdbCloseDBI(/*@null@*/ rpmdb db, int rpmtag) 00954 /*@globals fileSystem @*/ 00955 /*@modifies db, fileSystem @*/; 00956 00962 int rpmdbClose (/*@killref@*/ /*@only@*/ /*@null@*/ rpmdb db) 00963 /*@globals fileSystem @*/ 00964 /*@modifies db, fileSystem @*/; 00965 00971 int rpmdbSync (/*@null@*/ rpmdb db) 00972 /*@globals fileSystem @*/ 00973 /*@modifies fileSystem @*/; 00974 00980 /*@-exportlocal@*/ 00981 int rpmdbOpenAll (/*@null@*/ rpmdb db) 00982 /*@globals rpmGlobalMacroContext, h_errno @*/ 00983 /*@modifies db, rpmGlobalMacroContext @*/; 00984 /*@=exportlocal@*/ 00985 00994 int rpmdbCount(/*@null@*/ rpmdb db, rpmTag tag, 00995 const void * keyp, size_t keylen) 00996 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 00997 /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/; 00998 01005 int rpmdbCountPackages(/*@null@*/ rpmdb db, const char * name) 01006 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 01007 /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/; 01008 01014 unsigned int rpmdbGetIteratorOffset(/*@null@*/ rpmdbMatchIterator mi) 01015 /*@*/; 01016 01022 int rpmdbGetIteratorCount(/*@null@*/ rpmdbMatchIterator mi) 01023 /*@*/; 01024 01032 int rpmdbAppendIterator(/*@null@*/ rpmdbMatchIterator mi, 01033 /*@null@*/ const int * hdrNums, int nHdrNums) 01034 /*@modifies mi @*/; 01035 01045 int rpmdbPruneIterator(/*@null@*/ rpmdbMatchIterator mi, 01046 /*@null@*/ int * hdrNums, int nHdrNums, int sorted) 01047 /*@modifies mi, hdrNums @*/; 01048 01057 int rpmdbSetIteratorRE(/*@null@*/ rpmdbMatchIterator mi, rpmTag tag, 01058 rpmMireMode mode, /*@null@*/ const char * pattern) 01059 /*@globals rpmGlobalMacroContext, h_errno @*/ 01060 /*@modifies mi, mode, rpmGlobalMacroContext @*/; 01061 01069 int rpmdbSetIteratorRewrite(/*@null@*/ rpmdbMatchIterator mi, int rewrite) 01070 /*@modifies mi @*/; 01071 01078 int rpmdbSetIteratorModified(/*@null@*/ rpmdbMatchIterator mi, int modified) 01079 /*@modifies mi @*/; 01080 01088 int rpmdbSetHdrChk(/*@null@*/ rpmdbMatchIterator mi, /*@null@*/ rpmts ts, 01089 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void * uh, size_t uc, const char ** msg)) 01090 /*@modifies mi @*/; 01091 01100 /*@only@*/ /*@null@*/ 01101 rpmdbMatchIterator rpmdbInitIterator(/*@null@*/ rpmdb db, rpmTag rpmtag, 01102 /*@null@*/ const void * keyp, size_t keylen) 01103 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 01104 /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/; 01105 01111 /*@null@*/ 01112 Header rpmdbNextIterator(/*@null@*/ rpmdbMatchIterator mi) 01113 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 01114 /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/; 01115 01125 /*@mayexit@*/ 01126 int rpmdbCheckTerminate(int terminate) 01127 /*@globals fileSystem, internalState @*/ 01128 /*@modifies fileSystem, internalState @*/; 01129 01133 /*@mayexit@*/ 01134 int rpmdbCheckSignals(void) 01135 /*@globals fileSystem, internalState @*/ 01136 /*@modifies fileSystem, internalState @*/; 01137 01143 /*@null@*/ 01144 rpmdbMatchIterator rpmdbFreeIterator(/*@only@*/ /*@null@*/rpmdbMatchIterator mi) 01145 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 01146 /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/; 01147 01157 int rpmdbAdd(/*@null@*/ rpmdb db, int iid, Header h, /*@null@*/ rpmts ts, 01158 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg)) 01159 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 01160 /*@modifies db, h, rpmGlobalMacroContext, fileSystem, internalState @*/; 01161 01171 int rpmdbRemove(/*@null@*/ rpmdb db, /*@unused@*/ int rid, unsigned int hdrNum, 01172 /*@null@*/ rpmts ts, 01173 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg)) 01174 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 01175 /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/; 01176 01184 int rpmdbRebuild(/*@null@*/ const char * prefix, /*@null@*/ rpmts ts, 01185 /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg)) 01186 /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ 01187 /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; 01188 01189 #ifndef __APPLE__ 01190 01193 /*@unused@*/ 01194 int mergesort(void *base, size_t nmemb, size_t size, 01195 int (*cmp) (const void *, const void *)) 01196 /*@globals errno @*/ 01197 /*@modifies base, errno @*/; 01198 #else 01199 /* mergesort is defined in stdlib.h on Mac OS X */ 01200 #endif /* __APPLE__ */ 01201 01202 #ifdef __cplusplus 01203 } 01204 #endif 01205 01206 /*@=bounds@*/ 01207 #endif /* H_RPMDB */