12 #define _RPMDB_INTERNAL
20 #if defined(WITH_DB) || defined(WITH_SQLITE)
24 struct _dbiIndex db3dbi;
29 static int dbi_use_cursors;
34 static int dbi_tear_down;
41 struct poptOption rdbOptions[] = {
43 #if defined(WITH_DB) && defined(DB_CLIENT)
44 {
"client", 0,POPT_BIT_SET, &db3dbi.dbi_ecflags,
DB_CLIENT,
47 #if defined(WITH_DB) && defined(DB_RPCCLIENT)
48 {
"client", 0,POPT_BIT_SET, &db3dbi.dbi_ecflags, DB_RPCCLIENT,
50 {
"rpcclient", 0,POPT_BIT_SET, &db3dbi.dbi_ecflags, DB_RPCCLIENT,
54 #if defined(WITH_DB) && defined(DB_XA_CREATE)
55 {
"xa_create", 0,POPT_BIT_SET, &db3dbi.dbi_cflags, DB_XA_CREATE,
60 #if defined(WITH_DB) && defined(DB_AUTO_COMMIT)
61 {
"auto_commit", 0,POPT_BIT_SET, &db3dbi.dbi_oeflags, DB_AUTO_COMMIT,
64 #if defined(WITH_DB) && defined(DB_CREATE)
65 {
"create", 0,POPT_BIT_SET, &db3dbi.dbi_oeflags, DB_CREATE,
68 #if defined(WITH_DB) && defined(DB_MULTIVERSION)
69 {
"multiversion", 0,POPT_BIT_SET, &db3dbi.dbi_oeflags, DB_MULTIVERSION,
72 #if defined(WITH_DB) && defined(DB_NOMMAP)
73 {
"nommap", 0,POPT_BIT_SET, &db3dbi.dbi_oeflags, DB_NOMMAP,
76 #if defined(WITH_DB) && defined(DB_THREAD)
77 {
"thread", 0,POPT_BIT_SET, &db3dbi.dbi_oeflags, DB_THREAD,
81 #if defined(WITH_DB) && defined(DB_FORCE)
82 {
"force", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_FORCE,
88 #if defined(WITH_DB) && defined(DB_INIT_CDB)
89 {
"cdb", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_INIT_CDB,
92 #if defined(WITH_DB) && defined(DB_INIT_LOCK)
93 {
"lock", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_INIT_LOCK,
96 #if defined(WITH_DB) && defined(DB_INIT_LOG)
97 {
"log", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_INIT_LOG,
100 #if defined(WITH_DB) && defined(DB_INIT_MPOOL)
101 {
"mpool", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_INIT_MPOOL,
104 #if defined(WITH_DB) && defined(DB_INIT_REP)
105 {
"rep", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_INIT_REP,
108 #if defined(WITH_DB) && defined(DB_INIT_TXN)
109 {
"txn", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_INIT_TXN,
114 {
"joinenv", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_JOINENV,
117 #if defined(WITH_DB) && defined(DB_LOCKDOWN)
118 {
"lockdown", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_LOCKDOWN,
121 #if (defined(WITH_DB) || defined(WITH_SQLITE)) && defined(DB_PRIVATE)
122 {
"private", 0,POPT_BIT_SET, &db3dbi.dbi_eflags,
DB_PRIVATE,
125 #if defined(WITH_DB) && defined(DB_RECOVER)
126 {
"recover", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_RECOVER,
129 #if defined(WITH_DB) && defined(DB_RECOVER_FATAL)
130 {
"recover_fatal", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_RECOVER_FATAL,
133 #if defined(WITH_DB) && defined(DB_REGISTER)
134 {
"register", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_REGISTER,
137 #if defined(WITH_DB) && defined(DB_SYSTEM_MEM)
138 {
"shared", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_SYSTEM_MEM,
141 #if defined(WITH_DB) && defined(DB_TXN_NOSYNC)
142 {
"txn_nosync", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_TXN_NOSYNC,
145 #if defined(WITH_DB) && defined(DB_USE_ENVIRON_ROOT)
146 {
"use_environ_root", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_USE_ENVIRON_ROOT,
149 #if defined(WITH_DB) && defined(DB_USE_ENVIRON)
150 {
"use_environ", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_USE_ENVIRON,
153 #if defined(WITH_DB) && defined(DB_IGNORE_LEASE)
154 {
"ignore_lease", 0,POPT_BIT_SET, &db3dbi.dbi_eflags, DB_IGNORE_LEASE,
158 #if defined(WITH_DB) && defined(DB_TXN_SYNC)
159 {
"txn_sync", 0,POPT_BIT_SET, &db3dbi.dbi_tflags, DB_TXN_SYNC,
162 #if defined(WITH_DB) && defined(DB_TXN_NOWAIT)
163 {
"txn_nowait",0,POPT_BIT_SET, &db3dbi.dbi_tflags, DB_TXN_NOWAIT,
166 #if defined(WITH_DB) && defined(DB_TXN_WAIT)
167 {
"txn_wait",0,POPT_BIT_SET, &db3dbi.dbi_tflags, DB_TXN_WAIT,
171 #if defined(WITH_DB) && defined(NOTYET)
197 #if defined(WITH_DB) && defined(NOTYET)
203 DB_DUPSORT BTREE HASH
213 #if (defined(WITH_DB) || defined(WITH_SQLITE)) && defined(DB_EXCL)
214 {
"excl", 0,POPT_BIT_SET, &db3dbi.dbi_oflags,
DB_EXCL,
217 #if defined(WITH_DB) && defined(DB_FCNTL_LOCKING)
218 {
"fcntl_locking",0,POPT_BIT_SET, &db3dbi.dbi_oflags, DB_FCNTL_LOCKING,
221 #if defined(WITH_DB) && defined(DB_NO_AUTO_COMMIT) && defined(NOTYET)
222 {
"noautocommit", 0,POPT_BIT_SET, &db3dbi.dbi_oflags, DB_NO_AUTO_COMMIT,
225 #if defined(WITH_DB) && defined(DB_RDONLY)
226 {
"rdonly", 0,POPT_BIT_SET, &db3dbi.dbi_oflags, DB_RDONLY,
229 #if defined(WITH_DB) && defined(DB_RDWRMASTER) && defined(NOTYET)
230 {
"rdwrmaster", 0,POPT_BIT_SET, &db3dbi.dbi_oflags, DB_RDWRMASTER,
233 #if defined(WITH_DB) && defined(NOTYET)
236 #if defined(WITH_DB) && defined(DB_TRUNCATE)
237 {
"truncate", 0,POPT_BIT_SET, &db3dbi.dbi_oflags, DB_TRUNCATE,
240 #if defined(WITH_DB) && defined(DB_WRITEOPEN)
241 {
"writeopen", 0,POPT_BIT_SET, &db3dbi.dbi_oflags, DB_WRITEOPEN,
246 {
"btree", 0,POPT_ARG_VAL, &db3dbi.dbi_type, DB_BTREE,
248 {
"hash", 0,POPT_ARG_VAL, &db3dbi.dbi_type, DB_HASH,
250 {
"recno", 0,POPT_ARG_VAL, &db3dbi.dbi_type, DB_RECNO,
252 {
"queue", 0,POPT_ARG_VAL, &db3dbi.dbi_type, DB_QUEUE,
254 {
"unknown", 0,POPT_ARG_VAL, &db3dbi.dbi_type, DB_UNKNOWN,
258 {
"root", 0,POPT_ARG_STRING, &db3dbi.dbi_root, 0,
260 {
"home", 0,POPT_ARG_STRING, &db3dbi.dbi_home, 0,
262 {
"file", 0,POPT_ARG_STRING, &db3dbi.dbi_file, 0,
264 {
"subfile", 0,POPT_ARG_STRING, &db3dbi.dbi_subfile, 0,
267 {
"mode", 0,POPT_ARG_INT, &db3dbi.dbi_mode, 0,
270 {
"perms", 0,POPT_ARG_INT, &db3dbi.dbi_perms, 0,
273 {
"shmkey", 0,POPT_ARG_LONG, &db3dbi.dbi_shmkey, 0,
276 {
"tmpdir", 0,POPT_ARG_STRING, &db3dbi.dbi_tmpdir, 0,
280 {
"host", 0,POPT_ARG_STRING, &db3dbi.dbi_host, 0,
282 {
"server", 0,POPT_ARG_STRING, &db3dbi.dbi_host, 0,
284 {
"cl_timeout", 0,POPT_ARG_LONG, &db3dbi.dbi_cl_timeout, 0,
286 {
"sv_timeout", 0,POPT_ARG_LONG, &db3dbi.dbi_sv_timeout, 0,
291 {
"verify", 0,POPT_ARG_NONE, &db3dbi.dbi_verify_on_close, 0,
293 {
"teardown", 0,POPT_ARG_NONE, &dbi_tear_down, 0,
295 {
"usecursors",0,POPT_ARG_NONE, &dbi_use_cursors, 0,
297 {
"usedbenv", 0,POPT_ARG_NONE, &db3dbi.dbi_use_dbenv, 0,
300 {
"nofsync", 0,POPT_ARG_NONE, &db3dbi.dbi_no_fsync, 0,
303 {
"nodbsync", 0,POPT_ARG_NONE, &db3dbi.dbi_no_dbsync, 0,
305 {
"lockdbfd", 0,POPT_ARG_NONE, &db3dbi.dbi_lockdbfd, 0,
308 {
"noload", 0,POPT_ARG_NONE, &db3dbi.dbi_noload, 0,
310 {
"temporary", 0,POPT_ARG_NONE, &db3dbi.dbi_temporary, 0,
313 {
"debug", 0,POPT_ARG_NONE, &db3dbi.dbi_debug, 0,
318 {
"cachesize", 0,POPT_ARG_INT, &db3dbi.dbi_cachesize, 0,
323 {
"errpfx", 0,POPT_ARG_STRING, &db3dbi.dbi_errpfx, 0,
326 {
"lorder", 0,POPT_ARG_INT, &db3dbi.dbi_lorder, 0,
329 {
"pagesize", 0,POPT_ARG_INT, &db3dbi.dbi_pagesize, 0,
333 {
"region_init", 0,POPT_ARG_VAL, &db3dbi.dbi_region_init, 1,
336 {
"thread_count", 0,POPT_ARG_INT, &db3dbi.dbi_thread_count, 0,
340 #if defined(WITH_DB) && defined(DB_VERB_CHKPOINT)
341 {
"chkpoint", 0,POPT_BIT_SET, &db3dbi.dbi_verbose, DB_VERB_CHKPOINT,
344 #if defined(WITH_DB) && defined(DB_VERB_DEADLOCK)
345 {
"deadlock", 0,POPT_BIT_SET, &db3dbi.dbi_verbose, DB_VERB_DEADLOCK,
348 #if defined(WITH_DB) && defined(DB_VERB_RECOVERY)
349 {
"recovery", 0,POPT_BIT_SET, &db3dbi.dbi_verbose, DB_VERB_RECOVERY,
352 #if defined(WITH_DB) && defined(DB_VERB_REGISTER)
353 {
"register", 0,POPT_BIT_SET, &db3dbi.dbi_verbose, DB_VERB_REGISTER,
356 #if defined(WITH_DB) && defined(DB_VERB_REPLICATION)
357 {
"replication", 0,POPT_BIT_SET, &db3dbi.dbi_verbose, DB_VERB_REPLICATION,
360 #if defined(WITH_DB) && defined(DB_VERB_WAITSFOR)
361 {
"waitsfor", 0,POPT_BIT_SET, &db3dbi.dbi_verbose, DB_VERB_WAITSFOR,
364 #if defined(WITH_DB) && defined(DB_VERB_FILEOPS)
365 {
"fileops", 0,POPT_BIT_SET, &db3dbi.dbi_verbose, DB_VERB_FILEOPS,
368 #if defined(WITH_DB) && defined(DB_VERB_FILEOPS_ALL)
369 {
"fileops_all",0,POPT_BIT_SET,&db3dbi.dbi_verbose, DB_VERB_FILEOPS_ALL,
373 {
"verbose", 0,POPT_ARG_VAL, &db3dbi.dbi_verbose, -1,
381 #if defined(WITH_DB) && defined(DB_LOCK_DEFAULT)
382 {
"lk_default",0,POPT_ARG_VAL, &db3dbi.dbi_lk_detect, DB_LOCK_DEFAULT,
385 #if defined(WITH_DB) && defined(DB_LOCK_EXPIRE)
386 {
"lk_expire", 0,POPT_ARG_VAL, &db3dbi.dbi_lk_detect, DB_LOCK_EXPIRE,
389 #if defined(WITH_DB) && defined(DB_LOCK_MAXLOCKS)
390 {
"lk_maxlocks", 0,POPT_ARG_VAL, &db3dbi.dbi_lk_detect, DB_LOCK_MAXLOCKS,
393 #if defined(WITH_DB) && defined(DB_LOCK_MAXWRITE)
394 {
"lk_maxwrite", 0,POPT_ARG_VAL, &db3dbi.dbi_lk_detect, DB_LOCK_MAXWRITE,
397 #if defined(WITH_DB) && defined(DB_LOCK_MINLOCKS)
398 {
"lk_minlocks", 0,POPT_ARG_VAL, &db3dbi.dbi_lk_detect, DB_LOCK_MINLOCKS,
401 #if defined(WITH_DB) && defined(DB_LOCK_MINWRITE)
402 {
"lk_minwrite", 0,POPT_ARG_VAL, &db3dbi.dbi_lk_detect, DB_LOCK_MINWRITE,
405 #if defined(WITH_DB) && defined(DB_LOCK_OLDEST)
406 {
"lk_oldest", 0,POPT_ARG_VAL, &db3dbi.dbi_lk_detect, DB_LOCK_OLDEST,
409 #if defined(WITH_DB) && defined(DB_LOCK_RANDOM)
410 {
"lk_random", 0,POPT_ARG_VAL, &db3dbi.dbi_lk_detect, DB_LOCK_RANDOM,
413 #if defined(WITH_DB) && defined(DB_LOCK_YOUNGEST)
414 {
"lk_youngest",0, POPT_ARG_VAL, &db3dbi.dbi_lk_detect, DB_LOCK_YOUNGEST,
421 #if defined(WITH_DB) && defined(NOTYET)
434 {
"lk_max_lockers", 0,POPT_ARG_INT, &db3dbi.dbi_lk_max_lockers, 0,
438 {
"lk_max_locks", 0,POPT_ARG_INT, &db3dbi.dbi_lk_max_locks, 0,
442 {
"lk_max_objects", 0,POPT_ARG_INT, &db3dbi.dbi_lk_max_objects, 0,
447 #if defined(WITH_DB) && defined(NOTYET)
458 {
"lg_bsize", 0,POPT_ARG_INT, &db3dbi.dbi_lg_bsize, 0,
462 {
"lg_dir", 0,POPT_ARG_STRING, &db3dbi.dbi_lg_dir, 0,
466 {
"lg_filemode", 0,POPT_ARG_INT, &db3dbi.dbi_lg_filemode, 0,
470 {
"lg_max", 0,POPT_ARG_INT, &db3dbi.dbi_lg_max, 0,
474 {
"lg_regionmax", 0,POPT_ARG_INT, &db3dbi.dbi_lg_regionmax, 0,
480 {
"mp_size", 0,POPT_ARG_INT, &db3dbi.dbi_cachesize, 0,
484 {
"mmapsize", 0,POPT_ARG_INT, &db3dbi.dbi_mmapsize, 0,
486 {
"mp_mmapsize", 0,POPT_ARG_INT, &db3dbi.dbi_mmapsize, 0,
498 #if defined(WITH_DB) && defined(NOTYET)
499 DB_MUTEX_PROCESS_ONLY mutex_alloc
500 DB_MUTEX_SELF_BLOCK mutex_alloc
501 DB_STAT_CLEAR mutex_stat*
506 {
"mutex_align", 0,POPT_ARG_INT, &db3dbi.dbi_mutex_align, 0,
510 {
"mutex_increment", 0,POPT_ARG_INT, &db3dbi.dbi_mutex_increment, 0,
514 {
"mutex_max", 0,POPT_ARG_INT, &db3dbi.dbi_mutex_max, 0,
518 {
"mutex_tas_spins", 0,POPT_ARG_INT, &db3dbi.dbi_mutex_tas_spins, 0,
534 {
"seq_cachesize", 0,POPT_ARG_INT, &db3dbi.dbi_seq_cachesize, 0,
539 #if defined(WITH_DB) && defined(DB_SEQ_DEC)
540 {
"seq_dec", 0,POPT_BIT_SET, &db3dbi.dbi_seq_flags, DB_SEQ_DEC,
543 #if defined(WITH_DB) && defined(DB_SEQ_INC)
544 {
"seq_inc", 0,POPT_BIT_SET, &db3dbi.dbi_seq_flags, DB_SEQ_INC,
547 #if defined(WITH_DB) && defined(DB_SEQ_WRAP)
548 {
"seq_wrap", 0,POPT_BIT_SET, &db3dbi.dbi_seq_flags, DB_SEQ_WRAP,
553 #if defined(WITH_DB) && defined(NOTYET)
554 {
"seq_min", 0,POPT_ARG_INT, &db3dbi.dbi_seq_min, 0,
556 {
"seq_max", 0,POPT_ARG_INT, &db3dbi.dbi_seq_max, 0,
567 {
"tx_max", 0,POPT_ARG_INT, &db3dbi.dbi_tx_max, 0,
577 #if defined(WITH_DB) && defined(DB_DUP)
578 {
"bt_dup", 0,POPT_BIT_SET, &db3dbi.dbi_bt_flags, DB_DUP,
581 #if defined(WITH_DB) && defined(DB_DUPSORT)
582 {
"bt_dupsort",0,POPT_BIT_SET, &db3dbi.dbi_bt_flags, DB_DUPSORT,
585 #if defined(WITH_DB) && defined(DB_RECNUM)
586 {
"bt_recnum", 0,POPT_BIT_SET, &db3dbi.dbi_bt_flags, DB_RECNUM,
589 #if defined(WITH_DB) && defined(DB_REVSPLITOFF)
590 {
"bt_revsplitoff", 0,POPT_BIT_SET, &db3dbi.dbi_bt_flags, DB_REVSPLITOFF,
594 #if defined(WITH_DB) && defined(DB_DUP)
595 {
"h_dup", 0,POPT_BIT_SET, &db3dbi.dbi_h_flags, DB_DUP,
598 #if defined(WITH_DB) && defined(DB_SUPSORT)
599 {
"h_dupsort", 0,POPT_BIT_SET, &db3dbi.dbi_h_flags, DB_DUPSORT,
603 {
"h_ffactor", 0,POPT_ARG_INT, &db3dbi.dbi_h_ffactor, 0,
605 {
"h_nelem", 0,POPT_ARG_INT, &db3dbi.dbi_h_nelem, 0,
609 #if defined(WITH_DB) && defined(DB_RENUMBER)
610 {
"re_renumber", 0,POPT_BIT_SET, &db3dbi.dbi_re_flags, DB_RENUMBER,
613 #if defined(WITH_DB) && defined(DB_SNAPSHOT)
614 {
"re_snapshot",0,POPT_BIT_SET, &db3dbi.dbi_re_flags, DB_SNAPSHOT,
618 {
"re_delim", 0,POPT_ARG_INT, &db3dbi.dbi_re_delim, 0,
620 {
"re_len", 0,POPT_ARG_INT, &db3dbi.dbi_re_len, 0,
622 {
"re_pad", 0,POPT_ARG_INT, &db3dbi.dbi_re_pad, 0,
624 {
"re_source", 0,POPT_ARG_STRING, &db3dbi.dbi_re_source, 0,
627 {
"q_extentsize", 0,POPT_ARG_INT, &db3dbi.dbi_q_extentsize, 0,
638 dbi->dbi_root =
_free(dbi->dbi_root);
639 dbi->dbi_home =
_free(dbi->dbi_home);
640 dbi->dbi_file =
_free(dbi->dbi_file);
641 dbi->dbi_subfile =
_free(dbi->dbi_subfile);
642 dbi->dbi_tmpdir =
_free(dbi->dbi_tmpdir);
643 dbi->dbi_host =
_free(dbi->dbi_host);
644 dbi->dbi_errpfx =
_free(dbi->dbi_errpfx);
645 dbi->dbi_re_source =
_free(dbi->dbi_re_source);
646 dbi->dbi_stats =
_free(dbi->dbi_stats);
653 static const char *db3_config_default =
654 "hash tmpdir=/var/tmp create cdb mpool mp_mmapsize=16Mb mp_size=1Mb perms=0644";
661 if (!(dbOpts && *dbOpts && *dbOpts !=
'%')) {
662 dbOpts =
_free(dbOpts);
663 dbOpts =
rpmExpand(
"%{_dbi_config}", NULL);
664 if (!(dbOpts && *dbOpts && *dbOpts !=
'%')) {
665 dbOpts =
rpmExpand(db3_config_default, NULL);
670 if (dbOpts && *dbOpts && *dbOpts !=
'%') {
674 memset(&db3dbi, 0,
sizeof(db3dbi));
676 for (o = dbOpts; o && *o; o = oe) {
677 struct poptOption *opt;
686 for (oe = o; oe && *oe; oe++) {
689 if (oe[0] ==
':' && !(oe[1] ==
'/' && oe[2] ==
'/'))
698 for (pe = o; pe && *pe && *pe !=
'='; pe++)
700 p = (pe ? *pe++ =
'\0', pe : NULL);
703 for (tok = o; *tok ==
'!'; tok++)
707 for (opt = rdbOptions; opt->longName != NULL; opt++) {
708 if (strcmp(tok, opt->longName))
712 if (opt->longName == NULL) {
714 _(
"unrecognized db option: \"%s\" ignored.\n"), o);
719 argInfo = opt->argInfo;
720 if (argInfo == POPT_BIT_SET && *o ==
'!' && ((tok - o) % 2))
721 argInfo = POPT_BIT_CLR;
724 switch (argInfo & POPT_ARG_MASK) {
727 (void) poptSaveInt((
int *)opt->arg, argInfo, 1
L);
730 (void) poptSaveInt((
int *)opt->arg, argInfo, (long)opt->val);
732 case POPT_ARG_STRING:
733 {
const char ** t = opt->arg;
746 {
long aLong = strtol(p, &pe, 0);
749 aLong *= 1024 * 1024;
752 else if (*pe !=
'\0') {
754 _(
"%s has invalid numeric value, skipped\n"),
760 if ((argInfo & POPT_ARG_MASK) == POPT_ARG_LONG) {
761 if (aLong == LONG_MIN || aLong == LONG_MAX) {
763 _(
"%s has too large or too small long value, skipped\n"),
767 (void) poptSaveLong((
long *)opt->arg, argInfo, aLong);
770 if (aLong > INT_MAX || aLong < INT_MIN) {
772 _(
"%s has too large or too small integer value, skipped\n"),
776 (void) poptSaveInt((
int *)opt->arg, argInfo, aLong);
786 dbOpts =
_free(dbOpts);
791 memset(&db3dbi, 0,
sizeof(db3dbi));
793 if (!(dbi->dbi_perms & 0600))
794 dbi->dbi_perms = 0644;
795 dbi->dbi_mode = rpmdb->db_mode;
797 dbi->dbi_rpmdb =
rpmdb;
799 dbi->dbi_rpmtag = tag;
816 dbi->dbi_byteswapped = -1;
819 if (!dbi->dbi_use_dbenv) {
820 dbi->dbi_use_dbenv = 1;
821 dbi->dbi_eflags |= (DB_INIT_MPOOL|DB_JOINENV);
822 dbi->dbi_mmapsize = 16 * 1024 * 1024;
823 dbi->dbi_cachesize = 1 * 1024 * 1024;
826 if ((dbi->dbi_bt_flags | dbi->dbi_h_flags) & DB_DUP)
827 dbi->dbi_permit_dups = 1;
835 const char * prDbiOpenFlags(
int dbflags,
int print_dbenv_flags)
837 static char buf[256];
838 struct poptOption *opt;
843 for (opt = rdbOptions; opt->longName != NULL; opt++) {
844 if (opt->argInfo != POPT_BIT_SET)
846 if (print_dbenv_flags) {
847 if (!(opt->arg == &db3dbi.dbi_oeflags ||
848 opt->arg == &db3dbi.dbi_eflags))
851 if (!(opt->arg == &db3dbi.dbi_oeflags ||
852 opt->arg == &db3dbi.dbi_oflags))
855 if ((dbflags & opt->val) != opt->val)
859 oe =
stpcpy(oe, opt->longName);
860 dbflags &= ~opt->val;
865 sprintf(oe,
"0x%x", (
unsigned)dbflags);