rpm  5.4.10
rpmdb.h
Go to the documentation of this file.
1 #ifndef H_RPMDB
2 #define H_RPMDB
3 /*@-bounds@*/
4 
10 #include <assert.h>
11 #include <mire.h>
12 
13 #include <rpmtypes.h>
14 #include <rpmtag.h> /* XXX Header typedef */
15 
16 #if defined(_RPMDB_INTERNAL)
17 #if defined(WITH_DB)
18 #include <db.h>
19 #else
20 #include "db_emu.h"
21 #endif
22 #endif
23 
24 #if defined(_RPMDB_INTERNAL)
25 #define DBT_INIT /*@-fullinitblock@*/ {0} /*@-fullinitblock@*/ /* -Wno-missing-field-initializers */
26 #endif
27 
28 /*@-exportlocal@*/
29 /*@unchecked@*/
30 extern int _rpmdb_debug;
31 /*@unchecked@*/
32 extern int _rpmmi_debug;
33 /*@=exportlocal@*/
34 
35 #ifdef NOTYET
36 
39 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmdb_s * rpmdb;
40 
44 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmmi_s * rpmmi;
45 #endif
46 
49 typedef /*@abstract@*/ struct _dbiIndexItem * dbiIndexItem;
50 
54 typedef /*@abstract@*/ struct _dbiIndexSet * dbiIndexSet;
55 
58 typedef /*@abstract@*/ struct _dbiIndex * dbiIndex;
59 
60 #if defined(_RPMDB_INTERNAL)
61 #include <rpmio.h>
62 #include <rpmbf.h>
63 #include <rpmsw.h>
64 
65 #if !defined(SWIG) /* XXX inline dbiFoo() need */
66 
69 struct _dbiIndexItem {
70  uint32_t hdrNum;
71  uint32_t tagNum;
72 };
73 
77 struct _dbiIndexSet {
78 /*@owned@*/
79  struct _dbiIndexItem * recs;
80  unsigned int count;
81 };
82 
86 struct _dbiVec {
87  const char * dbv_version;
88  int dbv_major;
89  int dbv_minor;
90  int dbv_patch;
98  int (*open) (rpmdb rpmdb, rpmTag tag, /*@out@*/ dbiIndex * dbip)
99  /*@globals fileSystem @*/
100  /*@modifies *dbip, fileSystem @*/;
101 
108  int (*close) (/*@only@*/ dbiIndex dbi, unsigned int flags)
109  /*@globals fileSystem @*/
110  /*@modifies dbi, fileSystem @*/;
111 
118  int (*sync) (dbiIndex dbi, unsigned int flags)
119  /*@globals fileSystem @*/
120  /*@modifies fileSystem @*/;
121 
130  int (*associate) (dbiIndex dbi, dbiIndex dbisecondary,
131  int (*callback) (DB *, const DBT *, const DBT *, DBT *),
132  unsigned int flags)
133  /*@globals fileSystem @*/
134  /*@modifies dbi, fileSystem @*/;
135 
144  int (*associate_foreign) (dbiIndex dbi, dbiIndex dbisecondary,
145  int (*callback) (DB *, const DBT *, DBT *, const DBT *, int *),
146  unsigned int flags)
147  /*@globals fileSystem @*/
148  /*@modifies dbi, fileSystem @*/;
149 
158  int (*join) (dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp,
159  unsigned int flags)
160  /*@globals fileSystem @*/
161  /*@modifies dbi, *dbcp, fileSystem @*/;
162 
170  int (*exists) (dbiIndex dbi, DBT * key, unsigned int flags)
171  /*@globals fileSystem @*/
172  /*@modifies dbi, fileSystem @*/;
173 
181  int (*seqno) (dbiIndex dbi, /*@null@*/ int64_t * seqnop, unsigned int flags)
182  /*@globals fileSystem @*/
183  /*@modifies dbi, *seqnop, fileSystem @*/;
184 
193  int (*copen) (dbiIndex dbi, /*@null@*/ DB_TXN * txnid,
194  /*@out@*/ DBC ** dbcp, unsigned int dbiflags)
195  /*@globals fileSystem @*/
196  /*@modifies dbi, *txnid, *dbcp, fileSystem @*/;
197 
205  int (*cclose) (dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags)
206  /*@globals fileSystem @*/
207  /*@modifies dbi, *dbcursor, fileSystem @*/;
208 
217  int (*cdup) (dbiIndex dbi, DBC * dbcursor, /*@out@*/ DBC ** dbcp,
218  unsigned int flags)
219  /*@globals fileSystem @*/
220  /*@modifies dbi, *dbcp, fileSystem @*/;
221 
231  int (*cdel) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
232  unsigned int flags)
233  /*@globals fileSystem @*/
234  /*@modifies *dbcursor, fileSystem @*/;
235 
245  int (*cget) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
246  unsigned int flags)
247  /*@globals fileSystem @*/
248  /*@modifies *dbcursor, *key, *data, fileSystem @*/;
249 
260  int (*cpget) (dbiIndex dbi, /*@null@*/ DBC * dbcursor,
261  DBT * key, DBT * pkey, DBT * data, unsigned int flags)
262  /*@globals fileSystem @*/
263  /*@modifies *dbcursor, *key, *pkey, *data, fileSystem @*/;
264 
274  int (*cput) (dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
275  unsigned int flags)
276  /*@globals fileSystem @*/
277  /*@modifies *dbcursor, fileSystem @*/;
278 
287  int (*ccount) (dbiIndex dbi, DBC * dbcursor,
288  /*@out@*/ unsigned int * countp,
289  unsigned int flags)
290  /*@globals fileSystem @*/
291  /*@modifies *dbcursor, fileSystem @*/;
292 
298  int (*byteswapped) (dbiIndex dbi)
299  /*@globals fileSystem @*/
300  /*@modifies fileSystem @*/;
301 
308  int (*stat) (dbiIndex dbi, unsigned int flags)
309  /*@globals fileSystem @*/
310  /*@modifies dbi, fileSystem @*/;
311 };
312 
316 struct _dbiIndex {
317  struct rpmioItem_s _item;
318 /*@relnull@*/
319  const char * dbi_root;
320 /*@null@*/
321  const char * dbi_home;
322 /*@relnull@*/
323  const char * dbi_file;
324 /*@relnull@*/
325  const char * dbi_subfile;
326 /*@null@*/
327  const char * dbi_tmpdir;
329  int dbi_ecflags;
330  int dbi_cflags;
331  int dbi_oeflags;
332  int dbi_eflags;
333  int dbi_oflags;
334  int dbi_tflags;
336  int dbi_type;
337  unsigned dbi_mode;
338  int dbi_perms;
339  long dbi_shmkey;
340  int dbi_api;
342  int dbi_use_dbenv;
343  int dbi_no_fsync;
344  int dbi_no_dbsync;
345  int dbi_lockdbfd;
346  int dbi_temporary;
347  int dbi_debug;
348 
349  rpmbf dbi_bf;
350 
351 /*@null@*/
352  char * dbi_host;
353  unsigned long dbi_cl_timeout;
354  unsigned long dbi_sv_timeout;
355 
356  /* dbenv parameters */
357  int dbi_lorder;
358 /*@unused@*/
359  /* XXX db-4.3.14 adds dbenv as 1st arg. */
360  void (*db_errcall) (void * dbenv, const char *db_errpfx, char *buffer)
361  /*@globals fileSystem @*/
362  /*@modifies fileSystem @*/;
363 /*@unused@*/ /*@shared@*/
364  FILE * dbi_errfile;
365  const char * dbi_errpfx;
366  int dbi_region_init;
367  unsigned int dbi_thread_count;
368 
369  /* locking sub-system parameters */
370  /* logging sub-system parameters */
371  /* mpool sub-system parameters */
372  /* mutex sub-system parameters */
373  /* replication sub-system parameters */
374 
375  /* sequences sub-system parameters */
376  const char * dbi_seq_id;
377  unsigned int dbi_seq_cachesize;
378  unsigned int dbi_seq_flags;
379  int64_t dbi_seq_initial;
380  int64_t dbi_seq_min;
381  int64_t dbi_seq_max;
382  int64_t dbi_seqno;
383 
384  /* transaction sub-system parameters */
385 #if 0
386  int (*dbi_tx_recover) (DB_ENV *dbenv, DBT *log_rec,
387  DB_LSN *lsnp, int redo, void *info)
388  /*@globals fileSystem @*/
389  /*@modifies fileSystem @*/;
390 #endif
391  /* dbinfo parameters */
392  int dbi_pagesize;
393  int dbi_heapsize;
394  int dbi_heap_regionsize;
395 /*@unused@*/ /*@null@*/
396  void * (*dbi_malloc) (size_t nbytes)
397  /*@*/;
398  /* hash access parameters */
399  unsigned int dbi_h_ffactor;
400  unsigned int (*dbi_h_hash_fcn) (DB *, const void *bytes,
401  unsigned int length)
402  /*@*/;
403  unsigned int dbi_h_nelem;
404  unsigned int dbi_h_flags;
405  int (*dbi_h_dup_compare_fcn) (DB *, const DBT *, const DBT *)
406  /*@*/;
407  /* btree access parameters */
408  int dbi_bt_flags;
409  int dbi_bt_minkey;
410  int (*dbi_bt_compare_fcn) (DB *, const DBT *, const DBT *)
411  /*@*/;
412  int (*dbi_bt_dup_compare_fcn) (DB *, const DBT *, const DBT *)
413  /*@*/;
414  size_t (*dbi_bt_prefix_fcn) (DB *, const DBT *, const DBT *)
415  /*@*/;
416  /* recno access parameters */
417  int dbi_re_flags;
418  int dbi_re_delim;
419  unsigned int dbi_re_len;
420  int dbi_re_pad;
421  const char * dbi_re_source;
422  /* queue access parameters */
423  unsigned int dbi_q_extentsize;
424 
425 /*@null@*/
426  const char * dbi_primary;
427 /*@null@*/
428  const char * dbi_foreign;
429 
430 /*@refcounted@*/
431  rpmdb dbi_rpmdb;
432  rpmTag dbi_rpmtag;
433  size_t dbi_jlen;
435  int dbi_table_nkeys;
436  int dbi_table_exists;
438 /*@only@*/ /*@relnull@*/
439  void * dbi_seq;
440 /*@only@*/ /*@relnull@*/
441  void * dbi_db;
442 /*@only@*/ /*@null@*/
443  void * dbi_txnid;
444 /*@only@*/ /*@null@*/
445  void * dbi_stats;
447 /*@observer@*/
448  const struct _dbiVec * dbi_vec;
450 };
451 #endif /* !defined(SWIG) */
452 
456 struct rpmdb_s {
457  struct rpmioItem_s _item;
458 /*@owned@*/ /*@relnull@*/
459  const char * db_root;
460 /*@owned@*/
461  const char * db_home;
462  int db_flags;
463  int db_mode;
464  int db_perms;
465  int db_api;
466 /*@owned@*/
467  const char * db_errpfx;
469  int db_remove_env;
470  uint32_t db_maxkey;
472  int db_chrootDone;
473  void (*db_errcall) (const char * db_errpfx, char * buffer)
474  /*@*/;
475 /*@shared@*/
476  FILE * db_errfile;
477 /*@only@*/
478  void * (*db_malloc) (size_t nbytes)
479  /*@*/;
480 /*@only@*/
481  void * (*db_realloc) (/*@only@*//*@null@*/ void * ptr, size_t nbytes)
482  /*@*/;
483  void (*db_free) (/*@only@*/ void * ptr)
484  /*@modifies *ptr @*/;
485 
486  int (*db_export) (rpmdb db, Header h, int adding);
487 
488 /*@refcounted@*/
489  Header db_h;
491  rpmdb db_next;
492  int db_opens;
494  void * db_dbenv;
495  void * db_txn;
496  void * db_logc;
497  void * db_mpf;
499  tagStore_t db_tags;
500  size_t db_ndbi;
501 /*@only@*/ /*@null@*/
502  dbiIndex * _dbi;
504  struct rpmop_s db_getops;
505  struct rpmop_s db_putops;
506  struct rpmop_s db_delops;
508 #if defined(__LCLINT__)
509 /*@refs@*/
510  int nrefs;
511 #endif
512 };
513 #endif /* defined(_RPMDB_INTERNAL) */
514 
515 #ifdef __cplusplus
516 extern "C" {
517 #endif
518 
519 #if defined(_RPMDB_INTERNAL)
520 /*@-exportlocal@*/
521 #if defined(WITH_DB) || defined(WITH_SQLITE)
522 
528 /*@unused@*/ /*@only@*/ /*@null@*/
529 dbiIndex db3New(rpmdb rpmdb, rpmTag tag)
530  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
531  /*@modifies rpmGlobalMacroContext, internalState @*/;
532 
538 /*@null@*/
539 dbiIndex db3Free(/*@only@*/ /*@null@*/ dbiIndex dbi)
540  /*@globals fileSystem, internalState @*/
541  /*@modifies dbi, fileSystem, internalState @*/;
542 #define db3Free(_dbi) \
543  ((dbiIndex)rpmioFreePoolItem((rpmioItem)(_dbi), __FUNCTION__, __FILE__, __LINE__))
544 
551 /*@-redecl@*/
552 /*@exposed@*/
553 extern const char * prDbiOpenFlags(int dbflags, int print_dbenv_flags)
554  /*@*/;
555 /*@=redecl@*/
556 #endif
557 
565 /*@only@*/ /*@null@*/ dbiIndex dbiOpen(/*@null@*/ rpmdb db, rpmTag tag,
566  unsigned int flags)
567  /*@globals rpmGlobalMacroContext, errno, h_errno, internalState @*/
568  /*@modifies db, rpmGlobalMacroContext, errno, internalState @*/;
569 
576 void * dbiStatsAccumulator(dbiIndex dbi, int opx)
577  /*@*/;
578 
579 #if !defined(SWIG)
580 /*@-globuse -mustmod @*/ /* FIX: vector annotations */
589 /*@unused@*/ static inline
590 int dbiCopen(dbiIndex dbi, /*@null@*/ DB_TXN * txnid,
591  /*@out@*/ DBC ** dbcp, unsigned int flags)
592  /*@globals fileSystem @*/
593  /*@modifies dbi, *dbcp, fileSystem @*/
594 {
595  return (*dbi->dbi_vec->copen) (dbi, txnid, dbcp, flags);
596 }
597 
605 /*@unused@*/ static inline
606 int dbiCclose(dbiIndex dbi, /*@only@*/ DBC * dbcursor, unsigned int flags)
607  /*@globals fileSystem @*/
608  /*@modifies dbi, *dbcursor, fileSystem @*/
609 {
610  return (*dbi->dbi_vec->cclose) (dbi, dbcursor, flags);
611 }
612 
621 /*@unused@*/ static inline
622 int dbiCdup(dbiIndex dbi, DBC * dbcursor, /*@out@*/ DBC ** dbcp,
623  unsigned int flags)
624  /*@modifies dbi, *dbcp @*/
625 {
626  return (*dbi->dbi_vec->cdup) (dbi, dbcursor, dbcp, flags);
627 }
628 
638 /*@unused@*/ static inline
639 int dbiDel(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
640  unsigned int flags)
641  /*@globals fileSystem, internalState @*/
642  /*@modifies dbi, *dbcursor, fileSystem, internalState @*/
643 {
644  rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 16); /* RPMTS_OP_DBDEL */
645  int rc;
646  assert(key->data != NULL && key->size > 0);
647  (void) rpmswEnter(sw, 0);
648  rc = (dbi->dbi_vec->cdel) (dbi, dbcursor, key, data, flags);
649  (void) rpmswExit(sw, data->size);
650  return rc;
651 }
652 
662 /*@unused@*/ static inline
663 int dbiGet(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
664  unsigned int flags)
665  /*@globals fileSystem, internalState @*/
666  /*@modifies dbi, *dbcursor, *key, *data, fileSystem, internalState @*/
667 {
668  rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 14); /* RPMTS_OP_DBGET */
669  int rc;
670  (void) rpmswEnter(sw, 0);
671  rc = (dbi->dbi_vec->cget) (dbi, dbcursor, key, data, flags);
672  (void) rpmswExit(sw, data->size);
673  return rc;
674 }
675 
686 /*@unused@*/ static inline
687 int dbiPget(dbiIndex dbi, /*@null@*/ DBC * dbcursor,
688  DBT * key, DBT * pkey, DBT * data, unsigned int flags)
689  /*@globals fileSystem, internalState @*/
690  /*@modifies dbi, *dbcursor, *key, *pkey, *data, fileSystem, internalState @*/
691 {
692  rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 14); /* RPMTS_OP_DBGET */
693  int rc;
694  (void) rpmswEnter(sw, 0);
695  rc = (dbi->dbi_vec->cpget) (dbi, dbcursor, key, pkey, data, flags);
696  (void) rpmswExit(sw, data->size);
697  return rc;
698 }
699 
709 /*@unused@*/ static inline
710 int dbiPut(dbiIndex dbi, /*@null@*/ DBC * dbcursor, DBT * key, DBT * data,
711  unsigned int flags)
712  /*@globals fileSystem, internalState @*/
713  /*@modifies dbi, *dbcursor, *key, fileSystem, internalState @*/
714 {
715  rpmop sw = (rpmop)dbiStatsAccumulator(dbi, 15); /* RPMTS_OP_DBPUT */
716  int rc;
717  assert(key->data != NULL && key->size > 0 && data->data != NULL && data->size > 0);
718  (void) rpmswEnter(sw, 0);
719  rc = (dbi->dbi_vec->cput) (dbi, dbcursor, key, data, flags);
720  (void) rpmswExit(sw, data->size);
721  return rc;
722 }
723 
732 /*@unused@*/ static inline
733 int dbiCount(dbiIndex dbi, DBC * dbcursor, /*@out@*/ unsigned int * countp,
734  unsigned int flags)
735  /*@globals fileSystem @*/
736  /*@modifies *dbcursor, fileSystem @*/
737 {
738  return (*dbi->dbi_vec->ccount) (dbi, dbcursor, countp, flags);
739 }
740 
747 /*@unused@*/ static inline
748 int dbiClose(/*@only@*/ dbiIndex dbi, unsigned int flags)
749  /*@globals fileSystem @*/
750  /*@modifies dbi, fileSystem @*/
751 {
752  return (*dbi->dbi_vec->close) (dbi, flags);
753 }
754 
761 /*@unused@*/ static inline
762 int dbiSync (dbiIndex dbi, unsigned int flags)
763  /*@globals fileSystem @*/
764  /*@modifies fileSystem @*/
765 {
766  return (*dbi->dbi_vec->sync) (dbi, flags);
767 }
768 
776 /*@unused@*/ static inline
777 int dbiExists(dbiIndex dbi, /*@out@*/ DBT * key, unsigned int flags)
778  /*@globals fileSystem @*/
779  /*@modifies dbi, fileSystem @*/
780 {
781  return (*dbi->dbi_vec->exists) (dbi, key, flags);
782 }
783 
791 /*@unused@*/ static inline
792 int dbiSeqno(dbiIndex dbi, /*@null@*/ int64_t * seqnop, unsigned int flags)
793  /*@globals fileSystem @*/
794  /*@modifies dbi, *seqnop, fileSystem @*/
795 {
796  return (*dbi->dbi_vec->seqno) (dbi, seqnop, flags);
797 }
798 
807 /*@unused@*/ static inline
808 int dbiAssociate(dbiIndex dbi, dbiIndex dbisecondary,
809  int (*callback) (DB *, const DBT *, const DBT *, DBT *),
810  unsigned int flags)
811  /*@globals fileSystem @*/
812  /*@modifies dbi, fileSystem @*/
813 {
814  return (*dbi->dbi_vec->associate) (dbi, dbisecondary, callback, flags);
815 }
816 
825 /*@unused@*/ static inline
826 int dbiJoin(dbiIndex dbi, DBC ** curslist, /*@out@*/ DBC ** dbcp,
827  unsigned int flags)
828  /*@globals fileSystem @*/
829  /*@modifies dbi, *dbcp, fileSystem @*/
830 {
831  return (*dbi->dbi_vec->join) (dbi, curslist, dbcp, flags);
832 }
833 
839 /*@unused@*/ static inline
840 int dbiByteSwapped(dbiIndex dbi)
841  /*@modifies dbi @*/
842 {
843  return (*dbi->dbi_vec->byteswapped) (dbi);
844 }
845 
852 /*@unused@*/ static inline
853 int dbiStat(dbiIndex dbi, unsigned int flags)
854  /*@modifies dbi @*/
855 {
856  return (*dbi->dbi_vec->stat) (dbi, flags);
857 }
858 
864 /*@unused@*/ static inline /*@null@*/
865 DB_TXN * dbiTxnid(dbiIndex dbi)
866  /*@*/
867 {
868  rpmdb rpmdb = (dbi ? dbi->dbi_rpmdb : NULL);
869  DB_TXN * _txn = (DB_TXN*)(rpmdb ? rpmdb->db_txn : NULL);
870  return _txn;
871 }
872 
873 #if defined(_RPMDB_INTERNAL)
874 #if defined(WITH_DB)
875 #if !defined(__LCLINT__)
876 /*@unused@*/ static inline
877 int rpmlkId(rpmdb rpmdb, uint32_t *_idp)
878 {
879  DB_ENV * dbenv = (DB_ENV *) rpmdb->db_dbenv;
880  int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080)
881  ? dbenv->lock_id(dbenv, _idp) : ENOTSUP;
882 if (_rpmdb_debug)
883 fprintf(stderr, "<-- %s(%p,%p) id 0x%x rc %d\n", "dbenv->lock_id", dbenv, _idp, *_idp, rc);
884  return rc;
885 }
886 
887 /*@unused@*/ static inline
888 int rpmlkIdFree(rpmdb rpmdb, uint32_t _id)
889 {
890  DB_ENV * dbenv = (DB_ENV *)rpmdb->db_dbenv;
891  int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080)
892  ? dbenv->lock_id_free(dbenv, _id) : ENOTSUP;
893 if (_rpmdb_debug)
894 fprintf(stderr, "<-- %s(%p,%u) rc %d\n", "dbenv->lock_id_free", dbenv, (unsigned)_id, rc);
895  return rc;
896 }
897 
898 /*@unused@*/ static inline
899 int rpmlkGet(rpmdb rpmdb, DBT * _object, uint32_t _lockmode, void * _lock)
900 {
901  DB_ENV * dbenv = (DB_ENV *)rpmdb->db_dbenv;
902  uint32_t _locker = 0x12344321;
903  uint32_t _flags = 0;
904  int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080)
905  ? dbenv->lock_get(dbenv, _locker, _flags, _object, (db_lockmode_t)_lockmode, (DB_LOCK*)_lock)
906  : ENOTSUP;
907 if (_rpmdb_debug)
908 fprintf(stderr, "<-- %s(%p,0x%x,0x%x,%p,0x%x,%p) rc %d\n", "dbenv->lock_get", dbenv, _locker, _flags, _object, _lockmode, _lock, rc);
909  return rc;
910 }
911 
912 /*@unused@*/ static inline
913 int rpmlkPut(rpmdb rpmdb, void * _lock)
914 {
915  DB_ENV * dbenv = (DB_ENV *)rpmdb->db_dbenv;
916  int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x080)
917  ? dbenv->lock_put(dbenv, (DB_LOCK*)_lock)
918  : ENOTSUP;
919 if (_rpmdb_debug)
920 fprintf(stderr, "<-- %s(%p,%p) rc %d\n", "dbenv->lock_put", dbenv, _lock, rc);
921  return rc;
922 }
923 
924 /*@unused@*/ static inline
925 int rpmlgcOpen(rpmdb rpmdb)
926 {
927  DB_ENV * dbenv = (DB_ENV *)rpmdb->db_dbenv;
928  DB_LOGC * _logc = NULL;
929  uint32_t _flags = 0;
930  int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100)
931  ? dbenv->log_cursor(dbenv, &_logc, _flags) : ENOTSUP;
932  rpmdb->db_logc = (!rc ? _logc : NULL);
933 if (_rpmdb_debug)
934 fprintf(stderr, "<-- %s(%p,%p,0x%x) logc %p rc %d\n", "dbenv->log_cursor", dbenv, &_logc, _flags, _logc, rc);
935  return rc;
936 }
937 
938 /*@unused@*/ static inline
939 int rpmlgcGet(rpmdb rpmdb, DB_LSN * _lsn, DBT * data, uint32_t flags)
940 {
941  DB_LOGC * _logc = (DB_LOGC*)rpmdb->db_logc;
942  int rc = (_logc ? _logc->get(_logc, _lsn, data, flags) : ENOTSUP);
943 if (_rpmdb_debug)
944 fprintf(stderr, "<-- %s(%p,%p,%p,0x%x) rc %d\n", "logc->get", _logc, _lsn, data, flags, rc);
945  return rc;
946 }
947 
948 /*@unused@*/ static inline
949 int rpmlgcClose(rpmdb rpmdb)
950 {
951  DB_LOGC * _logc = (DB_LOGC*)rpmdb->db_logc;
952  uint32_t _flags = 0;
953  int rc = (_logc ? _logc->close(_logc, _flags) : ENOTSUP);
954  rpmdb->db_logc = NULL;
955 if (_rpmdb_debug)
956 fprintf(stderr, "<-- %s(%p) rc %d\n", "logc->close", _logc, rc);
957  return rc;
958 }
959 
960 /*@unused@*/ static inline
961 int rpmlgcFile(rpmdb rpmdb, const DB_LSN * _lsn, char * name, size_t len)
962 {
963  DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv;
964  int rc = dbenv->log_file(dbenv, _lsn, name, len);
965 if (_rpmdb_debug)
966 fprintf(stderr, "<-- %s(%p,%p,%p[%u]) \"%s\" rc %d\n", "dbenv->log_file", dbenv, _lsn, name, (unsigned)len, name, rc);
967  return rc;
968 }
969 
970 /*@unused@*/ static inline
971 int rpmlgcFlush(rpmdb rpmdb, const DB_LSN * _lsn)
972 {
973  DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv;
974  int rc = dbenv->log_flush(dbenv, _lsn);
975 if (_rpmdb_debug)
976 fprintf(stderr, "<-- %s(%p,%p) rc %d\n", "dbenv->log_flush", dbenv, _lsn, rc);
977  return rc;
978 }
979 
980 /*@unused@*/ static inline
981 int rpmlgcPrintf(rpmdb rpmdb, const char * fmt, void *_A1, void *_A2, void *_A3, void *_A4, void *_A5)
982 {
983  DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv;
984  DB_TXN * _txnid = (DB_TXN*)rpmdb->db_txn;
985  int rc = dbenv->log_printf(dbenv, _txnid, fmt, _A1, _A2, _A3, _A4, _A5);
986 if (_rpmdb_debug)
987 fprintf(stderr, "<-- %s(%p,%p,\"%s\", ...) rc %d\n", "dbenv->log_printf", dbenv, _txnid, fmt, rc);
988  return rc;
989 }
990 
991 /*@unused@*/ static inline
992 int rpmlgcPut(rpmdb rpmdb, DB_LSN * _lsn, const DBT * data, uint32_t flags)
993 {
994  DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv;
995  int rc = dbenv->log_put(dbenv, _lsn, data, flags);
996 if (_rpmdb_debug)
997 fprintf(stderr, "<-- %s(%p,%p,%p,0x%x) rc %d\n", "dbenv->log_put", dbenv, _lsn, data, flags, rc);
998  return rc;
999 }
1000 
1001 /*@unused@*/ static inline
1002 int rpmmpfSyncAll(rpmdb rpmdb)
1003 {
1004  DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv;
1005  DB_LSN * _lsn = NULL;
1006  int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100)
1007  ? dbenv->memp_sync(dbenv, _lsn) : ENOTSUP;
1008 if (_rpmdb_debug)
1009 fprintf(stderr, "<-- %s(%p,%p) rc %d\n", "dbenv->memp_sync", dbenv, _lsn, rc);
1010  return rc;
1011 }
1012 
1013 /*@unused@*/ static inline
1014 int rpmmpfTrickle(rpmdb rpmdb)
1015 {
1016  DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv;
1017  int _percent = 20;
1018  int _nwrote = 0;
1019  int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100)
1020  ? dbenv->memp_trickle(dbenv, _percent, &_nwrote) : ENOTSUP;
1021 if (_rpmdb_debug)
1022 fprintf(stderr, "<-- %s(%p,%d) nwrote %d rc %d\n", "dbenv->memp_trickle", dbenv, _percent, _nwrote, rc);
1023  return rc;
1024 }
1025 
1026 /*@unused@*/ static inline
1027 int rpmmpfClose(rpmdb rpmdb)
1028 {
1029  DB_MPOOLFILE * mpf = (DB_MPOOLFILE*)rpmdb->db_mpf;
1030  uint32_t _flags = 0;
1031  int rc = (mpf ? mpf->close(mpf, _flags) : ENOTSUP);
1032  rpmdb->db_mpf = NULL;
1033 if (_rpmdb_debug)
1034 fprintf(stderr, "<-- %s(%p) rc %d\n", "mpf->close", mpf, rc);
1035  return rc;
1036 }
1037 
1038 /*@unused@*/ static inline
1039 int rpmmpfGet(rpmdb rpmdb, uint32_t * _pgnop, uint32_t _flags, void ** _pagep)
1040 {
1041  DB_MPOOLFILE * mpf = (DB_MPOOLFILE*)rpmdb->db_mpf;
1042  DB_TXN * _txnid = (DB_TXN*)rpmdb->db_txn;
1043  int rc = mpf->get(mpf, _pgnop, _txnid, _flags, _pagep);
1044 if (_rpmdb_debug)
1045 fprintf(stderr, "<-- %s(%p,%p,%p,0x%x,%p) rc %d\n", "mpf->get", mpf, _pgnop, _txnid, _flags, _pagep, rc);
1046  return rc;
1047 }
1048 
1049 /*@unused@*/ static inline
1050 int rpmmpfOpen(rpmdb rpmdb, /*@null@*/ const char * fn, uint32_t flags)
1051 {
1052  DB_ENV * dbenv = (DB_ENV*)rpmdb->db_dbenv;
1053  DB_MPOOLFILE * mpf = NULL;
1054  int _perms = rpmdb->_dbi[0]->dbi_perms;
1055  size_t _pagesize = BUFSIZ;
1056  uint32_t _fcreate_flags = 0;
1057  int rc = (rpmdb->_dbi[0]->dbi_eflags & 0x100)
1058  ? dbenv->memp_fcreate(dbenv, &mpf, _fcreate_flags) : ENOTSUP;
1059 
1060 if (_rpmdb_debug)
1061 fprintf(stderr, "<-- %s(%p,&mpf,0x%x) mpf %p rc %d\n", "dbenv->memp_fcreate", dbenv, _fcreate_flags, mpf, rc);
1062  if (rc) goto exit;
1063  rc = mpf->open(mpf, fn, flags, _perms, _pagesize);
1064  rpmdb->db_mpf = (!rc ? mpf : NULL); /* FIXME: mpf memleak */
1065 if (_rpmdb_debug)
1066 fprintf(stderr, "<-- %s(%p,%s,0x%x) rc %d\n", "mpf->open", mpf, fn, flags, rc);
1067 
1068 exit:
1069  return rc;
1070 }
1071 
1072 /*@unused@*/ static inline
1073 int rpmmpfPut(rpmdb rpmdb, void * _page, uint32_t flags)
1074 {
1075  DB_MPOOLFILE * mpf = (DB_MPOOLFILE*) rpmdb->db_mpf;
1076  uint32_t _priority = DB_PRIORITY_DEFAULT;
1077  int rc = mpf->put(mpf, _page, (DB_CACHE_PRIORITY)_priority, flags);
1078 if (_rpmdb_debug)
1079 fprintf(stderr, "<-- %s(%p,%p,0x%x,0x%x) rc %d\n", "mpf->put", mpf, _page, _priority, flags, rc);
1080  return rc;
1081 }
1082 
1083 /*@unused@*/ static inline
1084 int rpmmpfSync(rpmdb rpmdb)
1085 {
1086  DB_MPOOLFILE * mpf = (DB_MPOOLFILE*)rpmdb->db_mpf;
1087  int rc = (mpf ? mpf->sync(mpf) : ENOTSUP);
1088 if (_rpmdb_debug)
1089 fprintf(stderr, "<-- %s(%p) rc %d\n", "mpf->close", mpf, rc);
1090  return rc;
1091 }
1092 #endif /* __LCLINT__ */
1093 #endif /* defined(WITH_DB) */
1094 #endif /* _RPMDB_INTERNAL */
1095 /*@=globuse =mustmod @*/
1096 #endif /* !defined(SWIG) */
1097 
1098 /*@=exportlocal@*/
1099 
1105 /*@null@*/
1106 dbiIndexSet dbiFreeIndexSet(/*@only@*/ /*@null@*/ dbiIndexSet set)
1107  /*@modifies set @*/;
1108 
1114 unsigned int dbiIndexSetCount(dbiIndexSet set)
1115  /*@*/;
1116 
1123 uint32_t dbiIndexRecordOffset(dbiIndexSet set, unsigned int recno)
1124  /*@*/;
1125 
1132 uint32_t dbiIndexRecordFileNumber(dbiIndexSet set, unsigned int recno)
1133  /*@*/;
1134 #endif /* defined(_RPMDB_INTERNAL) */
1135 
1142 /*@unused@*/ /*@null@*/
1143 rpmdb rpmdbUnlink (/*@killref@*/ /*@only@*/ rpmdb db, const char * msg)
1144  /*@modifies db @*/;
1145 #define rpmdbUnlink(_db, _msg) \
1146  ((rpmdb)rpmioUnlinkPoolItem((rpmioItem)(_db), _msg, __FILE__, __LINE__))
1147 
1154 /*@unused@*/ /*@newref@*/
1155 rpmdb rpmdbLink (rpmdb db, const char * msg)
1156  /*@modifies db @*/;
1157 #define rpmdbLink(_db, _msg) \
1158  ((void *)rpmioLinkPoolItem((rpmioItem)(_db), _msg, __FILE__, __LINE__))
1159 
1162 /*@only@*/ /*@null@*/
1163 rpmdb rpmdbNew(/*@kept@*/ /*@null@*/ const char * root,
1164  /*@kept@*/ /*@null@*/ const char * home,
1165  int mode, mode_t perms, int flags)
1166  /*@globals fileSystem, internalState @*/
1167  /*@modifies fileSystem, internalState @*/;
1168 
1177 int rpmdbOpen(/*@null@*/ const char * prefix, /*@null@*/ /*@out@*/ rpmdb * dbp,
1178  int mode, mode_t perms)
1179  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
1180  /*@modifies *dbp, rpmGlobalMacroContext, fileSystem, internalState @*/;
1181 
1188 int rpmdbBlockDBI(/*@null@*/ rpmdb db, int tag)
1189  /*@modifies db @*/;
1190 
1197 int rpmdbCloseDBI(/*@null@*/ rpmdb db, int tag)
1198  /*@globals fileSystem @*/
1199  /*@modifies db, fileSystem @*/;
1200 
1206 int rpmdbClose (/*@killref@*/ /*@only@*/ /*@null@*/ rpmdb db)
1207  /*@globals fileSystem @*/
1208  /*@modifies db, fileSystem @*/;
1209 
1215 /*@-exportlocal@*/
1216 int rpmdbOpenAll (/*@null@*/ rpmdb db)
1217  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
1218  /*@modifies db, rpmGlobalMacroContext, internalState @*/;
1219 /*@=exportlocal@*/
1220 
1229 int rpmdbCount(/*@null@*/ rpmdb db, rpmTag tag,
1230  const void * keyp, size_t keylen)
1231  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
1232  /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
1233 
1240 int rpmdbCountPackages(/*@null@*/ rpmdb db, const char * N)
1241  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
1242  /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
1243 
1249 uint32_t rpmmiInstance(/*@null@*/ rpmmi mi)
1250  /*@*/;
1251 
1257 uint32_t rpmmiBNTag(/*@null@*/ rpmmi mi)
1258  /*@*/;
1259 
1265 unsigned int rpmmiCount(/*@null@*/ rpmmi mi)
1266  /*@*/;
1267 
1275 int rpmmiGrow(/*@null@*/ rpmmi mi,
1276  /*@null@*/ const uint32_t * hdrNums, int nHdrNums)
1277  /*@modifies mi @*/;
1278 
1285 int rpmmiGrowBasename(rpmmi mi, const char * bn)
1286  /*@modifies mi @*/;
1287 
1293 int rpmmiSort(/*@null@*/ rpmmi mi)
1294  /*@modifies mi @*/;
1295 
1305 int rpmmiPrune(/*@null@*/ rpmmi mi,
1306  /*@null@*/ uint32_t * hdrNums, int nHdrNums, int sorted)
1307  /*@modifies mi, hdrNums @*/;
1308 
1317 int rpmmiAddPattern(/*@null@*/ rpmmi mi, rpmTag tag,
1318  rpmMireMode mode, /*@null@*/ const char * pattern)
1319  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
1320  /*@modifies mi, mode, rpmGlobalMacroContext, internalState @*/;
1321 
1329 int rpmmiSetRewrite(/*@null@*/ rpmmi mi, int rewrite)
1330  /*@modifies mi @*/;
1331 
1338 int rpmmiSetModified(/*@null@*/ rpmmi mi, int modified)
1339  /*@modifies mi @*/;
1340 
1349 /*@only@*/ /*@null@*/
1350 rpmmi rpmmiInit(/*@null@*/ rpmdb db, rpmTag tag,
1351  /*@null@*/ const void * keyp, size_t keylen)
1352  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
1353  /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/;
1354 
1360 /*@null@*/
1361 Header rpmmiNext(/*@null@*/ rpmmi mi)
1362  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
1363  /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
1364 
1374 /*@mayexit@*/
1375 int rpmdbCheckTerminate(int terminate)
1376  /*@globals fileSystem, internalState @*/
1377  /*@modifies fileSystem, internalState @*/;
1378 
1382 /*@mayexit@*/
1383 int rpmdbCheckSignals(void)
1384  /*@globals fileSystem, internalState @*/
1385  /*@modifies fileSystem, internalState @*/;
1386 
1392 /*@null@*/
1393 rpmmi rpmmiUnlink(/*@only@*/ /*@null@*/rpmmi mi)
1394  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
1395  /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
1396 #define rpmmiUnlink(_mi) \
1397  ((rpmmi)rpmioUnlinkPoolItem((rpmioItem)(_mi), __FUNCTION__, __FILE__, __LINE__))
1398 
1404 /*@null@*/
1405 rpmmi rpmmiLink(/*@only@*/ /*@null@*/rpmmi mi)
1406  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
1407  /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
1408 #define rpmmiLink(_mi) \
1409  ((rpmmi)rpmioLinkPoolItem((rpmioItem)(_mi), __FUNCTION__, __FILE__, __LINE__))
1410 
1416 /*@null@*/
1417 rpmmi rpmmiFree(/*@only@*/ /*@null@*/rpmmi mi)
1418  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
1419  /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/;
1420 #define rpmmiFree(_mi) \
1421  ((rpmmi)rpmioFreePoolItem((rpmioItem)(_mi), __FUNCTION__, __FILE__, __LINE__))
1422 
1432 int rpmdbMireApply(rpmdb db, rpmTag tag, rpmMireMode mode, const char * pat,
1433  const char *** argvp)
1434  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
1435  /*@modifies db, *argvp,
1436  rpmGlobalMacroContext, fileSystem, internalState @*/;
1437 
1446 int rpmdbAdd(/*@null@*/ rpmdb db, int iid, Header h, /*@null@*/ rpmts ts)
1447  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
1448  /*@modifies db, h, ts,
1449  rpmGlobalMacroContext, fileSystem, internalState @*/;
1450 
1459 int rpmdbRemove(/*@null@*/ rpmdb db, /*@unused@*/ int rid, uint32_t hdrNum,
1460  /*@null@*/ rpmts ts)
1461  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
1462  /*@modifies db, ts,
1463  rpmGlobalMacroContext, fileSystem, internalState @*/;
1464 
1468 /*@unused@*/
1469 int rpm_mergesort(void *base, size_t nmemb, size_t size,
1470  int (*cmp) (const void *, const void *))
1471  /*@globals errno @*/
1472  /*@modifies base, errno @*/;
1473 
1474 #ifdef __cplusplus
1475 }
1476 #endif
1477 
1478 /*@=bounds@*/
1479 #endif /* H_RPMDB */
int rpmmiAddPattern(rpmmi mi, rpmTag tag, rpmMireMode mode, const char *pattern)
Add pattern to iterator selector.
Definition: rpmdb.c:1906
rpmtime_t rpmswExit(rpmop op, ssize_t rc)
Exit timed operation.
Definition: rpmsw.c:264
int rpm_mergesort(void *base, size_t nmemb, size_t size, int(*cmp)(const void *, const void *))
Mergesort, same arguments as qsort(2).
Definition: merge.c:213
Header rpmmiNext(rpmmi mi)
Return next package header from iteration.
Definition: rpmdb.c:2248
#define rpmmiUnlink(_mi)
Definition: rpmdb.h:1396
int rpmmiSetRewrite(rpmmi mi, int rewrite)
Prepare iterator for lazy writes.
Definition: rpmdb.c:2166
int rpmdbOpenAll(rpmdb db)
Open all database indices.
Definition: rpmdb.c:787
int _rpmdb_debug
Definition: rpmdb.c:61
int rpmdbCount(rpmdb db, rpmTag tag, const void *keyp, size_t keylen)
Return number of instances of key in a tag index.
Definition: rpmdb.c:1188
The Header data structure.
int rpmdbCheckTerminate(int terminate)
Check rpmdb signal handler for trapped signal and/or requested exit.
Definition: rpmdb.c:476
static rpmlogRec recs
Definition: rpmlog.c:21
int rpmdbAdd(rpmdb db, int iid, Header h, rpmts ts)
Add package header to rpm database and indices.
Definition: rpmdb.c:2884
Definition: rpmdb.c:436
uint32_t rpmmiBNTag(rpmmi mi)
Return basename tag for current position of rpmdb iterator.
Definition: rpmdb.c:1752
struct _dbiIndexSet * dbiIndexSet
A single element (i.e.
Definition: rpmdb.h:54
int rpmdbMireApply(rpmdb db, rpmTag tag, rpmMireMode mode, const char *pat, const char ***argvp)
Return array of keys matching a pattern.
Definition: rpmdb.c:1482
uint32_t dbiIndexRecordFileNumber(dbiIndexSet set, unsigned int recno)
Definition: rpmdb.c:423
int rpmmiSort(rpmmi mi)
Sort iterator instances.
Definition: rpmdb.c:2416
dbiIndexSet dbiFreeIndexSet(dbiIndexSet set)
Definition: rpmdb.c:428
int rpmdbCountPackages(rpmdb db, const char *N)
Return number of instances of package in Name index.
Definition: rpmdb.c:1238
int rpmdbCloseDBI(rpmdb db, int tag)
Close a single database index.
Definition: rpmdb.c:839
void * data
Definition: db_emu.h:22
int rpmdbRemove(rpmdb db, int rid, uint32_t hdrNum, rpmts ts)
Remove package header from rpm database and indices.
Definition: rpmdb.c:2773
rpmmi rpmmiInit(rpmdb db, rpmTag tag, const void *keyp, size_t keylen)
Return database iterator.
Definition: rpmdb.c:2491
RPM pattern matching.
#define rpmdbUnlink(_db, _msg)
Definition: rpmdb.h:1145
int rpmdbBlockDBI(rpmdb db, int tag)
Block access to a single database index.
Definition: rpmdb.c:821
#define rpmmiFree(_mi)
Definition: rpmdb.h:1420
int _rpmmi_debug
Definition: rpmdb.c:64
int rpmmiSetModified(rpmmi mi, int modified)
Modify iterator to mark header for lazy write on release.
Definition: rpmdb.c:2179
int rpmmiGrowBasename(rpmmi mi, const char *bn)
Append packages containing common basename to iterator.
Definition: rpmdb.c:1491
struct tagStore_s * tagStore_t
Definition: rpmtag.h:522
void * dbiStatsAccumulator(dbiIndex dbi, int opx)
Definition: rpmdb.c:1603
struct rpmdb_s * rpmdb
Database of headers and tag value indices.
Definition: rpmtypes.h:43
struct rpmmi_s * rpmmi
Database iterator.
Definition: rpmtypes.h:48
int rpmswEnter(rpmop op, ssize_t rc)
Enter timed operation.
Definition: rpmsw.c:248
struct rpmop_s * rpmop
Definition: rpmsw.h:18
enum rpmMireMode_e rpmMireMode
Tag value pattern match mode.
uint32_t size
Definition: db_emu.h:23
Cumulative statistics for an operation.
Definition: rpmsw.h:33
uint32_t rpmmiInstance(rpmmi mi)
Return header instance for current position of rpmdb iterator.
Definition: rpmdb.c:1743
int rpmdbOpen(const char *prefix, rpmdb *dbp, int mode, mode_t perms)
Open rpm database.
Definition: rpmdb.c:1175
rpmdb rpmdbNew(const char *root, const char *home, int mode, mode_t perms, int flags)
Definition: rpmdb.c:1004
uint32_t dbiIndexRecordOffset(dbiIndexSet set, unsigned int recno)
Definition: rpmdb.c:418
static const char * prefix[]
Tables for prefixing and suffixing patterns, according to the -w, -x, and -F options.
Definition: rpmgrep.c:183
dbiIndex dbiOpen(rpmdb db, rpmTag tag, unsigned int flags)
Definition: rpmdb.c:223
Definition: db_emu.h:72
struct rpmts_s * rpmts
The RPM Transaction Set.
Definition: rpmtypes.h:14
int rpmdbClose(rpmdb db)
Close all database indices and free rpmdb.
Definition: rpmdb.c:866
#define rpmdbLink(_db, _msg)
Definition: rpmdb.h:1157
unsigned int rpmmiCount(rpmmi mi)
Return number of elements in rpm database iterator.
Definition: rpmdb.c:1759
#define rpmmiLink(_mi)
Definition: rpmdb.h:1408
Definition: db_emu.h:17
static const char * name
int rpmmiPrune(rpmmi mi, uint32_t *hdrNums, int nHdrNums, int sorted)
Remove items from set of package instances to iterate.
Definition: rpmdb.c:2449
int rpmmiGrow(rpmmi mi, const uint32_t *hdrNums, int nHdrNums)
Append items to set of package instances to iterate.
Definition: rpmdb.c:2475
int rpmdbCheckSignals(void)
Check for and exit on termination signals.
Definition: rpmdb.c:523
struct _dbiIndexItem * dbiIndexItem
Definition: rpmdb.h:49
enum rpmTag_e rpmTag
Definition: rpmtag.h:471
struct _dbiIndex * dbiIndex
Definition: rpmdb.h:58
unsigned int dbiIndexSetCount(dbiIndexSet set)
Definition: rpmdb.c:413