‰PNG  IHDR @ @ ªiqÞ pHYs   šœ —tEXtComment ELF>l@@R@8 @@@@@@88@8@@@KK MM`M`p MM`M`TT@T@DDPtdII@I@DDQtdRtdMM`M`@@/lib64/ld-linux-x86-64.so.2GNU GNU8n=ΒJ^xD4]~ @ !#BE|qX@ 9vgs}Y* g9 $o+M jK`P`0Q`P` h @$@libdb-4.7.so_ITM_deregisterTMCloneTable__gmon_start___Jv_RegisterClasses_ITM_registerTMCloneTabledb_strerror__os_callocdb_version_init__config_split_fini__db_getulong__os_strdup__db_rpathlibpthread.so.0__errno_locationlibc.so.6fopenoptindputs__stack_chk_failstdinfgetsgetopt__fprintf_chkfclosestrcasecmp__ctype_b_locoptargstderrfreopenfwritestrchr__libc_start_main_edata__bss_start_end/usr/lib64GLIBC_2.2.5GLIBC_2.3GLIBC_2.3.4GLIBC_2.4 ui ii ti ii ui O`O` O`O`O`P` P`(P`0P`8P`@P`HP` PP` XP` `P` hP`pP`xP`P`P`P`P`P`P`P`P`P`P`HH}D HtH5rD %tD @%rD h%jD h%bD h%ZD h%RD h%JD h%BD h%:D hp%2D h`%*D h P%"D h @%D h 0%D h % D h %D h%C h%C h%C h%C h%C h%C h%C h%C hAWAVAUAATUHSHL%C I$Md$H>PL5C HIHIHHD$E1HgHD1tV wHcHHDB D;(OHLB IH2H81 H[]A\A]A^A_HB HHD$HA H5HHA H8&HZ8IHA IHLHA H81tHA H5lL8L1tbH5FLtWH57L tDH5(LA111:H1E1AHEIfH@ H8 uDI<$Et>AH@ H=$HuH|$^1I^HHPTI$@H0$@H @fP`UH-P`HHw]øHt]P`P`UH-P`HHHH?HHu]úHt]HƿP`=@ uUH~]@ @H== tHtUM`H]{sAWH[H5AVAUATUSHHHHDHHHM@ H=`HH '@ H=IL5B@ I.Ht|] aH]8Hu,]@H H=? H1H[PHt3D] EuLHMHH=? 1H[PHuHm(HuH ? H=bAI.HUH]8Hu6K HP1H= H HH81H[PHuHm(HAM>MIo8HttLe MtaM.MtYI]8Hu(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g(HH+H5(LuXAf=g0 YHj0 LL$1HT$(1AH0[HT$H0 PfH5((LtmH5(LA=/ H/ LL$1HT$(1AH0HT$H/ P@A=/ Hr/ HP bH5'Lu'AO=P/ BH3/ HP0#H5\'Lu*A=/ H. @DH5&'LuVA=. H. LL$1HT$(1AH0HT$H. P4H5&L%Ak=l. ^L%o. LL$1HT$(1AI4$_HT$H. 1LL$I4$1AP #include #include #include #include #ifdef _WIN32 #include #define mkdir(dir, perm) _mkdir(dir) #endif #include "db.h" /* Global environment and database handles for use by the application */ /* Public functions for use by the application */ int bdb_startup(void); int bdb_shutdown(void); DB_ENV *%s_dbenv; /* Database environment handle */ DB *%s; /* Database handle */ DB *%s_%s; /* Database handle */ /* DB_ENV initialization structures */ typedef struct { DB_ENV **envpp; char *home; u_int32_t gbytes; u_int32_t bytes; u_int32_t ncache; int private; int transaction; } env_list_t; static env_list_t env_list[] = { static int bdb_%s_callback(DB *secondary, const DBT *key, const DBT *data , DBT *result) { secondary->errx(secondary, "%s: missing callback comparison function"); return (DB_DONOTINDEX); } Warning: you must write a comparison function for the %s database result->data = &((u_int8_t *)data->data)[%d]; result->size = %d; return (0); } static int bdb_%s_compare(DB *, const DBT *, const DBT *); static int bdb_%s_compare(DB *dbp, const DBT *a, const DBT *b) { %s ai, bi; memcpy(&ai, a->data, sizeof(ai)); memcpy(&bi, b->data, sizeof(bi)); return (ai < bi ? -1 : (ai > bi ? 1 : 0)); } /* DB initialization structures */ typedef struct db_list_t { DB_ENV **envpp; DB **dbpp; char *name; DBTYPE type; u_int32_t extentsize; u_int32_t pagesize; u_int32_t re_len; int (*key_compare)(DB *, const DBT *, const DBT *); DB **primaryp; int (*secondary_callback)(DB *, const DBT *, const DBT *, DBT *); int dupsort; int recnum; int transaction; } db_list_t; static db_list_t db_list[] = { %s { &%s_dbenv, "%s", %lu, %lu, %lu, %d, %d#ifdef BUILD_STANDALONE int main() { return (bdb_startup() && bdb_shutdown() ? EXIT_FAILURE : EXIT_SUCCESS); } #endif static int bdb_env_startup(env_list_t *); static int bdb_env_shutdown(env_list_t *); static int bdb_db_startup(db_list_t *); static int bdb_db_shutdown(db_list_t *); /* * bdb_startup -- * Start up the environments and databases. */ int bdb_startup() { u_int i; /* Open environments. */ for (i = 0; i < sizeof(env_list) / sizeof(env_list[0]); ++i) if (bdb_env_startup(&env_list[i])) return (1); /* Open primary databases. */ for (i = 0; i < sizeof(db_list) / sizeof(db_list[0]); ++i) if (db_list[i].primaryp == NULL && bdb_db_startup(&db_list[i])) return (1); /* Open secondary databases. */ for (i = 0; i < sizeof(db_list) / sizeof(db_list[0]); ++i) if (db_list[i].primaryp != NULL && bdb_db_startup(&db_list[i])) return (1); return (0); } /* * bdb_shutdown -- * Shut down the environments and databases. */ int bdb_shutdown() { u_int i; /* Close secondary databases. */ for (i = 0; i < sizeof(db_list) / sizeof(db_list[0]); ++i) if (db_list[i].primaryp != NULL && bdb_db_shutdown(&db_list[i])) return (1); /* Close primary databases. */ for (i = 0; i < sizeof(db_list) / sizeof(db_list[0]); ++i) if (db_list[i].primaryp == NULL && bdb_db_shutdown(&db_list[i])) return (1); /* Close environments. */ for (i = 0; i < sizeof(env_list) / sizeof(env_list[0]); ++i) if (bdb_env_shutdown(&env_list[i])) return (1); return (0); } static int bdb_env_startup(env_list_t *ep) { struct stat sb; DB_ENV *dbenv; u_int32_t open_flags; int ret; /* * If the directory doesn't exist, create it with permissions limited * to the owner. Assume errors caused by the directory not existing; * we'd like to avoid interpreting system errors and it won't hurt to * attempt to create an existing directory. * * !!! * We use octal for the permissions, nothing else is portable. */ if (stat(ep->home, &sb) != 0) (void)mkdir(ep->home, 0700); /* * If the environment is not transactional, remove and re-create it. */ if (!ep->transaction) { if ((ret = db_env_create(&dbenv, 0)) != 0) { fprintf(stderr, "db_env_create: %%s", db_strerror(ret)); return (1); } if ((ret = dbenv->remove(dbenv, ep->home, DB_FORCE)) != 0) { dbenv->err(dbenv, ret, "DB_ENV->remove: %%s", ep->home); goto err; } } /* * Create the DB_ENV handle and initialize error reporting. */ if ((ret = db_env_create(&dbenv, 0)) != 0) { fprintf(stderr, "db_env_create: %%s", db_strerror(ret)); return (1); } dbenv->set_errpfx(dbenv, ep->home); dbenv->set_errfile(dbenv, stderr); /* Configure the cache size. */ if ((ep->gbytes != 0 || ep->bytes != 0) && (ret = dbenv->set_cachesize(dbenv, ep->gbytes, ep->bytes, ep->ncache)) != 0) { dbenv->err(dbenv, ret, "DB_ENV->set_cachesize"); goto err; } /* * Open the environment. */ open_flags = DB_CREATE | DB_INIT_MPOOL | DB_THREAD; if (ep->private) open_flags |= DB_PRIVATE; if (ep->transaction) open_flags |= DB_INIT_LOCK | DB_INIT_LOG | DB_INIT_TXN | DB_RECOVER; if ((ret = dbenv->open(dbenv, ep->home, open_flags, 0)) != 0) { dbenv->err(dbenv, ret, "DB_ENV->open: %%s", ep->home); goto err; } *ep->envpp = dbenv; return (0); err: (void)dbenv->close(dbenv, 0); return (1); } static int bdb_db_startup(db_list_t *dp) { DB_ENV *dbenv; DB *dbp; int ret; dbenv = dp->envpp == NULL ? NULL : *dp->envpp; /* * If the database is not transactional, remove it and re-create it. */ if (!dp->transaction) { if ((ret = db_create(&dbp, dbenv, 0)) != 0) { if (dbenv == NULL) fprintf(stderr, "db_create: %%s\n", db_strerror(ret)); else dbenv->err(dbenv, ret, "db_create"); return (1); } if ((ret = dbp->remove( dbp, dp->name, NULL, 0)) != 0 && ret != ENOENT) { if (dbenv == NULL) fprintf(stderr, "DB->remove: %%s: %%s\n", dp->name, db_strerror(ret)); else dbenv->err( dbenv, ret, "DB->remove: %%s", dp->name); return (1); } } if ((ret = db_create(&dbp, dbenv, 0)) != 0) { if (dbenv == NULL) fprintf(stderr, "db_create: %%s\n", db_strerror(ret)); else dbenv->err(dbenv, ret, "db_create"); return (1); } if (dbenv == NULL) { dbp->set_errpfx(dbp, dp->name); dbp->set_errfile(dbp, stderr); } if (dp->dupsort && (ret = dbp->set_flags(dbp, DB_DUPSORT)) != 0) { dbp->err(dbp, ret, "DB->set_flags: DB_DUPSORT: %%s", dp->name); goto err; } if (dp->recnum && (ret = dbp->set_flags(dbp, DB_RECNUM)) != 0) { dbp->err(dbp, ret, "DB->set_flags: DB_RECNUM: %%s", dp->name); goto err; } if (dp->extentsize != 0 && (ret = dbp->set_q_extentsize(dbp, dp->extentsize)) != 0) { dbp->err(dbp, ret, "DB->set_q_extentsize: %%lu: %%s", (u_long)dp->extentsize, dp->name); goto err; } if (dp->pagesize != 0 && (ret = dbp->set_pagesize(dbp, dp->pagesize)) != 0) { dbp->err(dbp, ret, "DB->set_pagesize: %%lu: %%s", (u_long)dp->pagesize, dp->name); goto err; } if (dp->re_len != 0 && (ret = dbp->set_re_len(dbp, dp->re_len)) != 0) { dbp->err(dbp, ret, "DB->set_re_len: %%lu: %%s", (u_long)dp->re_len, dp->name); goto err; } if (dp->key_compare != NULL && (ret = dbp->set_bt_compare(dbp, dp->key_compare)) != 0) { dbp->err(dbp, ret, "DB->set_bt_compare"); goto err; } if ((ret = dbp->open(dbp, NULL, dp->name, NULL, dp->type, (dp->transaction ? DB_AUTO_COMMIT : 0) | DB_CREATE | DB_THREAD, 0)) != 0) { dbp->err(dbp, ret, "DB->open: %%s", dp->name); goto err; } if (dp->primaryp != NULL && (ret = dbp->associate(*dp->primaryp, NULL, dbp, dp->secondary_callback, DB_CREATE)) != 0) { dbp->err(dbp, ret, "DB->associate: %%s", dp->name); goto err; } *dp->dbpp = dbp; return (0); err: (void)dbp->close(dbp, 0); return (1); } static int bdb_env_shutdown(env_list_t *ep) { DB_ENV *dbenv; int ret; dbenv = ep->envpp == NULL ? NULL : *ep->envpp; ret = 0; if (dbenv != NULL && (ret = dbenv->close(dbenv, 0)) != 0) fprintf(stderr, "DB_ENV->close: %%s: %%s\n", ep->home, db_strerror(ret)); return (ret == 0 ? 0 : 1); } static int bdb_db_shutdown(db_list_t *dp) { DB_ENV *dbenv; DB *dbp; int ret; dbenv = dp->envpp == NULL ? NULL : *dp->envpp; dbp = *dp->dbpp; ret = 0; /* * If the database is transactionally protected, close without writing; * dirty pages; otherwise, flush dirty pages to disk. */ if (dbp != NULL && (ret = dbp->close(dbp, dp->transaction ? DB_NOSYNC : 0)) != 0) { if (dbenv == NULL) fprintf(stderr, "DB->close: %%s: %%s\n", dp->name, db_strerror(ret)); else dbenv->err(dbenv, ret, "DB->close: %%s", dp->name); } return (ret == 0 ? 0 : 1); } %s { %s%s%s, &%s%s%s, "%s", %s, %lu, %lu, %lu, %s%s%s, %s%s%s%s, %s%s%s, %d, %d, %dDB_BTREEDB_HASHDB_QUEUEDB_RECNO%s: %d: line too longenvironment.homecachesizeprivatedatabasecustomdupsortextentsizekey_typepagesizeprimaryrecnumre_lensecondary_offsettransactionbtreehashqueuerecno%s: line %d: %s: invalid input ;D`0XzRx t*zRx $hFJ w?;*3$"LD\BBB E(A0D8DP 8A0A(B BBBA LY BPB B(A0A8J 8A0A(B BBBA Lp BBB E(A0F8Go 8A0A(B BBBA D4eBEE E(H0H8M@l8A0A(B BBB|0@@ h @ $@M`M`o@0@@  P`(@ @@x oX@oo@M` @ @ @ @ @ @ @ @& @6 @F @V @f @v @ @ @ @ @ @ @ @ @ @GCC: (GNU) 4.8.2 20140120 (Red Hat 4.8.2-16).shstrtab.interp.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.jcr.dynamic.got.got.plt.data.bss.comment 8@8T@T !t@t$4o@8> @`F0@0No@H[oX@Xpj@xt@ @@ ( ~h @h y @  @ $@$ $@$$I@IDI@IM`MM`MM`MM`MO`O(P`PP`PP`PP0P-Q