db3.c   db3.c 
skipping to change at line 244 skipping to change at line 244
} }
#define _ENTRY(_v) { DB_##_v, #_v, } #define _ENTRY(_v) { DB_##_v, #_v, }
/*@unchecked@*/ /*@observer@*/ /*@unchecked@*/ /*@observer@*/
static KEY DBeflags[] = { static KEY DBeflags[] = {
_ENTRY(INIT_CDB), _ENTRY(INIT_CDB),
_ENTRY(INIT_LOCK), _ENTRY(INIT_LOCK),
_ENTRY(INIT_LOG), _ENTRY(INIT_LOG),
_ENTRY(INIT_MPOOL), _ENTRY(INIT_MPOOL),
_ENTRY(INIT_MUTEX), /* XXX not in DBENV->open() doco */
_ENTRY(INIT_REP), _ENTRY(INIT_REP),
_ENTRY(INIT_TXN), _ENTRY(INIT_TXN),
_ENTRY(RECOVER), _ENTRY(RECOVER),
_ENTRY(RECOVER_FATAL), _ENTRY(RECOVER_FATAL),
_ENTRY(USE_ENVIRON), _ENTRY(USE_ENVIRON),
_ENTRY(USE_ENVIRON_ROOT), _ENTRY(USE_ENVIRON_ROOT),
_ENTRY(CREATE), _ENTRY(CREATE),
_ENTRY(LOCKDOWN), _ENTRY(LOCKDOWN),
#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) || (DB_VERSION_MAJOR = = 5) #if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) || (DB_VERSION_MAJOR = = 5)
_ENTRY(FAILCHK), _ENTRY(FAILCHK),
skipping to change at line 341 skipping to change at line 342
static char buf[BUFSIZ]; static char buf[BUFSIZ];
char * te = buf; char * te = buf;
te = stpcpy(te, "\n\tflags: "); te = stpcpy(te, "\n\tflags: ");
(void) fmtBits(flags, DBafflags, nDBafflags, te); (void) fmtBits(flags, DBafflags, nDBafflags, te);
return buf; return buf;
} }
#define _AFFLAGS(_afflags) fmtDBafflags(_afflags) #define _AFFLAGS(_afflags) fmtDBafflags(_afflags)
/*@unchecked@*/ /*@observer@*/ /*@unchecked@*/ /*@observer@*/
static KEY DBCoflags[] = { static KEY DBCoflags[] = {
#ifdef NOTYET /* XXX DB->cursor() doco for db-5.1.19 lists, undef'd */ /* XXX DB->cursor() doco for db-5.1.19 lists, undef'd */
_ENTRY(BULK), #if defined(DB_CURSOR_BULK)
_ENTRY(CURSOR_BULK),
#endif #endif
_ENTRY(READ_COMMITTED), _ENTRY(READ_COMMITTED),
_ENTRY(READ_UNCOMMITTED), _ENTRY(READ_UNCOMMITTED),
_ENTRY(WRITECURSOR), _ENTRY(WRITECURSOR),
_ENTRY(TXN_SNAPSHOT), _ENTRY(TXN_SNAPSHOT),
}; };
/*@unchecked@*/ /*@unchecked@*/
static size_t nDBCoflags = sizeof(DBCoflags) / sizeof(DBCoflags[0]); static size_t nDBCoflags = sizeof(DBCoflags) / sizeof(DBCoflags[0]);
/*@observer@*/ /*@observer@*/
static const char * fmtDBCoflags(uint32_t flags) static const char * fmtDBCoflags(uint32_t flags)
skipping to change at line 440 skipping to change at line 442
#define _DBT_ENTRY(_v) { DB_DBT_##_v, #_v, } #define _DBT_ENTRY(_v) { DB_DBT_##_v, #_v, }
/*@unchecked@*/ /*@observer@*/ /*@unchecked@*/ /*@observer@*/
static KEY DBTflags[] = { static KEY DBTflags[] = {
_DBT_ENTRY(MALLOC), _DBT_ENTRY(MALLOC),
_DBT_ENTRY(REALLOC), _DBT_ENTRY(REALLOC),
_DBT_ENTRY(USERMEM), _DBT_ENTRY(USERMEM),
_DBT_ENTRY(PARTIAL), _DBT_ENTRY(PARTIAL),
_DBT_ENTRY(APPMALLOC), _DBT_ENTRY(APPMALLOC),
_DBT_ENTRY(MULTIPLE), _DBT_ENTRY(MULTIPLE),
#if defined(DB_DBT_READONLY) /* XXX db-5.2.28 */
_DBT_ENTRY(READONLY),
#endif
}; };
/*@unchecked@*/ /*@unchecked@*/
static size_t nDBTflags = sizeof(DBTflags) / sizeof(DBTflags[0]); static size_t nDBTflags = sizeof(DBTflags) / sizeof(DBTflags[0]);
/*@observer@*/ /*@observer@*/
static char * fmtDBT(const DBT * K, char * te) static char * fmtDBT(const DBT * K, char * te)
/*@modifies te @*/ /*@modifies te @*/
{ {
static size_t keymax = 35; static size_t keymax = 35;
int unprintable; int unprintable;
uint32_t i; uint32_t i;
skipping to change at line 710 skipping to change at line 715
} }
return _ncores; return _ncores;
} }
/*==============================================================*/ /*==============================================================*/
#define _TABLE(_v) { #_v, DB_EVENT_##_v } #define _TABLE(_v) { #_v, DB_EVENT_##_v }
static struct _events_s { static struct _events_s {
const char * n; const char * n;
uint32_t v; uint32_t v;
} _events[] = { } _events[] = {
#if (DB_VERSION_MAJOR == 5 && DB_VERSION_MINOR == 2)
_TABLE(PANIC), /* 0 */
_TABLE(REG_ALIVE), /* 1 */
_TABLE(REG_PANIC), /* 2 */
_TABLE(REP_CLIENT), /* 3 */
_TABLE(REP_CONNECT_BROKEN), /* 4 */
_TABLE(REP_CONNECT_ESTD), /* 5 */
_TABLE(REP_CONNECT_TRY_FAILED), /* 6 */
_TABLE(REP_DUPMASTER), /* 7 */
_TABLE(REP_ELECTED), /* 8 */
_TABLE(REP_ELECTION_FAILED),/* 9 */
_TABLE(REP_INIT_DONE), /* 10 */
_TABLE(REP_JOIN_FAILURE), /* 11 */
_TABLE(REP_LOCAL_SITE_REMOVED), /* 12 */
_TABLE(REP_MASTER), /* 13 */
_TABLE(REP_MASTER_FAILURE), /* 14 */
_TABLE(REP_NEWMASTER), /* 15 */
_TABLE(REP_PERM_FAILED), /* 16 */
_TABLE(REP_SITE_ADDED), /* 17 */
_TABLE(REP_SITE_REMOVED), /* 18 */
_TABLE(REP_STARTUPDONE), /* 19 */
_TABLE(REP_WOULD_ROLLBACK), /* 20 */
_TABLE(WRITE_FAILED), /* 21 */
_TABLE(NO_SUCH_EVENT), /* 22 */
_TABLE(NO_SUCH_EVENT), /* 23 */
_TABLE(NO_SUCH_EVENT), /* 24 */
_TABLE(NO_SUCH_EVENT), /* 25 */
_TABLE(NO_SUCH_EVENT), /* 26 */
_TABLE(NO_SUCH_EVENT), /* 27 */
_TABLE(NO_SUCH_EVENT), /* 28 */
_TABLE(NO_SUCH_EVENT), /* 29 */
_TABLE(NO_SUCH_EVENT), /* 30 */
_TABLE(NO_SUCH_EVENT), /* 31 */
#elif (DB_VERSION_MAJOR == 5 && DB_VERSION_MINOR < 2)
/* XXX numbered from db-5.1.19, older versions are different. */ /* XXX numbered from db-5.1.19, older versions are different. */
#if (DB_VERSION_MAJOR == 5)
_TABLE(PANIC), /* 0 */ _TABLE(PANIC), /* 0 */
_TABLE(REG_ALIVE), /* 1 */ _TABLE(REG_ALIVE), /* 1 */
_TABLE(REG_PANIC), /* 2 */ _TABLE(REG_PANIC), /* 2 */
_TABLE(REP_CLIENT), /* 3 */ _TABLE(REP_CLIENT), /* 3 */
_TABLE(REP_DUPMASTER), /* 4 */ _TABLE(REP_DUPMASTER), /* 4 */
_TABLE(REP_ELECTED), /* 5 */ _TABLE(REP_ELECTED), /* 5 */
_TABLE(REP_ELECTION_FAILED),/* 6 */ _TABLE(REP_ELECTION_FAILED),/* 6 */
_TABLE(REP_JOIN_FAILURE), /* 7 */ _TABLE(REP_JOIN_FAILURE), /* 7 */
_TABLE(REP_MASTER), /* 8 */ _TABLE(REP_MASTER), /* 8 */
_TABLE(REP_MASTER_FAILURE), /* 9 */ _TABLE(REP_MASTER_FAILURE), /* 9 */
_TABLE(REP_NEWMASTER), /* 10 */ _TABLE(REP_NEWMASTER), /* 10 */
_TABLE(REP_PERM_FAILED), /* 11 */ _TABLE(REP_PERM_FAILED), /* 11 */
_TABLE(REP_STARTUPDONE), /* 12 */ _TABLE(REP_STARTUPDONE), /* 12 */
_TABLE(WRITE_FAILED), /* 13 */ _TABLE(WRITE_FAILED), /* 13 */
_TABLE(NO_SUCH_EVENT), /* 14 */ _TABLE(NO_SUCH_EVENT), /* 14 */
_TABLE(NO_SUCH_EVENT), /* 15 */ _TABLE(NO_SUCH_EVENT), /* 15 */
_TABLE(NO_SUCH_EVENT), /* 16 */
_TABLE(NO_SUCH_EVENT), /* 17 */
_TABLE(NO_SUCH_EVENT), /* 18 */
_TABLE(NO_SUCH_EVENT), /* 19 */
_TABLE(NO_SUCH_EVENT), /* 20 */
_TABLE(NO_SUCH_EVENT), /* 21 */
_TABLE(NO_SUCH_EVENT), /* 22 */
_TABLE(NO_SUCH_EVENT), /* 23 */
_TABLE(NO_SUCH_EVENT), /* 24 */
_TABLE(NO_SUCH_EVENT), /* 25 */
_TABLE(NO_SUCH_EVENT), /* 26 */
_TABLE(NO_SUCH_EVENT), /* 27 */
_TABLE(NO_SUCH_EVENT), /* 28 */
_TABLE(NO_SUCH_EVENT), /* 29 */
_TABLE(NO_SUCH_EVENT), /* 30 */
_TABLE(NO_SUCH_EVENT), /* 31 */
#else #else
_TABLE(NO_SUCH_EVENT), /* 0 */ _TABLE(NO_SUCH_EVENT), /* 0 */
_TABLE(PANIC), /* 1 */ _TABLE(PANIC), /* 1 */
#if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) #if (DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8)
_TABLE(REG_ALIVE), /* 2 */ _TABLE(REG_ALIVE), /* 2 */
_TABLE(REG_PANIC), /* 3 */ _TABLE(REG_PANIC), /* 3 */
#else #else
_TABLE(NO_SUCH_EVENT), /* 2 */ _TABLE(NO_SUCH_EVENT), /* 2 */
_TABLE(NO_SUCH_EVENT), /* 3 */ _TABLE(NO_SUCH_EVENT), /* 3 */
#endif #endif
skipping to change at line 750 skipping to change at line 804
_TABLE(REP_MASTER), /* 6 */ _TABLE(REP_MASTER), /* 6 */
_TABLE(REP_NEWMASTER), /* 7 */ _TABLE(REP_NEWMASTER), /* 7 */
_TABLE(REP_PERM_FAILED), /* 8 */ _TABLE(REP_PERM_FAILED), /* 8 */
_TABLE(REP_STARTUPDONE), /* 9 */ _TABLE(REP_STARTUPDONE), /* 9 */
_TABLE(WRITE_FAILED), /* 10 */ _TABLE(WRITE_FAILED), /* 10 */
_TABLE(NO_SUCH_EVENT), /* 11 */ _TABLE(NO_SUCH_EVENT), /* 11 */
_TABLE(NO_SUCH_EVENT), /* 12 */ _TABLE(NO_SUCH_EVENT), /* 12 */
_TABLE(NO_SUCH_EVENT), /* 13 */ _TABLE(NO_SUCH_EVENT), /* 13 */
_TABLE(NO_SUCH_EVENT), /* 14 */ _TABLE(NO_SUCH_EVENT), /* 14 */
_TABLE(NO_SUCH_EVENT), /* 15 */ _TABLE(NO_SUCH_EVENT), /* 15 */
_TABLE(NO_SUCH_EVENT), /* 16 */
_TABLE(NO_SUCH_EVENT), /* 17 */
_TABLE(NO_SUCH_EVENT), /* 18 */
_TABLE(NO_SUCH_EVENT), /* 19 */
_TABLE(NO_SUCH_EVENT), /* 20 */
_TABLE(NO_SUCH_EVENT), /* 21 */
_TABLE(NO_SUCH_EVENT), /* 22 */
_TABLE(NO_SUCH_EVENT), /* 23 */
_TABLE(NO_SUCH_EVENT), /* 24 */
_TABLE(NO_SUCH_EVENT), /* 25 */
_TABLE(NO_SUCH_EVENT), /* 26 */
_TABLE(NO_SUCH_EVENT), /* 27 */
_TABLE(NO_SUCH_EVENT), /* 28 */
_TABLE(NO_SUCH_EVENT), /* 29 */
_TABLE(NO_SUCH_EVENT), /* 30 */
_TABLE(NO_SUCH_EVENT), /* 31 */
#endif #endif
}; };
#undef _TABLE #undef _TABLE
static void static void
rpmdbe_event_notify(DB_ENV * dbenv, u_int32_t event, void * event_info) rpmdbe_event_notify(DB_ENV * dbenv, u_int32_t event, void * event_info)
{ {
void * o = (dbenv ? dbenv->app_private : NULL); void * o = (dbenv ? dbenv->app_private : NULL);
fprintf(stderr, "==> %s(%p, %s(%u), %p) app_private %p\n", __FUNCTION__, db env, _events[event & 0xf].n, event, event_info, o); fprintf(stderr, "==> %s(%p, %s(%u), %p) app_private %p\n", __FUNCTION__, db env, _events[event & 0x1f].n, event, event_info, o);
} }
static void static void
rpmdbe_feedback(DB_ENV * dbenv, int opcode, int percent) rpmdbe_feedback(DB_ENV * dbenv, int opcode, int percent)
/*@*/ /*@*/
{ {
dbenv = NULL; dbenv = NULL;
dbenv = dbenv; dbenv = dbenv;
switch (opcode) { switch (opcode) {
case DB_RECOVER: case DB_RECOVER:
skipping to change at line 2472 skipping to change at line 2542
if (rc) break; if (rc) break;
} }
break; break;
case DB_QUEUE: case DB_QUEUE:
if (dbi->dbi_q_extentsize) { if (dbi->dbi_q_extentsize) {
rc = db->set_q_extentsize(db, dbi->dbi_q_extentsize) ; rc = db->set_q_extentsize(db, dbi->dbi_q_extentsize) ;
rc = cvtdberr(dbi, "db->set_q_extentsize", rc, _debu g); rc = cvtdberr(dbi, "db->set_q_extentsize", rc, _debu g);
if (rc) break; if (rc) break;
} }
break; break;
#if defined(DB_HEAP) /* XXX FIXME: db-5.2.28 parameters */
case DB_HEAP:
if (dbi->dbi_heapsize) {
static uint32_t _gbytes = 0;
static uint32_t _bytes = dbi->db_heapsize;
assert(_heapsize >= (3 * dbi->dbi_pagesize));
rc = db->set_heapsize(db, _gbytes, _bytes);
rc = cvtdberr(dbi, "db->set_heapsize", rc, _debug);
if (rc) break;
}
break;
#endif
} }
} }
if (rc == 0) { if (rc == 0) {
const char * dbfullpath; const char * dbfullpath;
const char * dbpath; const char * dbpath;
char * t; char * t;
int nb; int nb;
nb = strlen(dbhome); nb = strlen(dbhome);
 End of changes. 9 change blocks. 
4 lines changed or deleted 86 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/