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