ELF>0 @@PN@8@@@@@@@@@@JJ JJ`J`@ JJ`J`@@ PtdXIXI@XI@44Qtd/lib64/ld-linux-x86-64.so.2GNU    `a*k  B=^  c$74zq~I)1^})T?M`6M`libdb-4.6.so__gmon_start___Jv_RegisterClassesdb_strerror__os_callocdb_version__config_split__db_getulong__os_strdup__db_rpathlibpthread.so.0__errno_locationlibc.so.6fopenoptindputsstdinfgetsgetoptfclosestrcasecmp__ctype_b_locoptargstderrfreopenfwritestrchrfprintf__libc_start_mainenv_treeprognameGLIBC_2.2.5DB4_6GLIBC_2.3 ui H &ZHTii Zui HpL`xL`L` L` L`L`L`L`L`L`L`L`L`L` L` M` M`M`M` M`(M`0M`8M`@M`HM`PM`XM``M`H2}H5A %A @%A h%A h%A h%A h%A h%A h%A h%A hp%A h`%A h P%A h @%A h 0%A h %zA h %rA h%jA h%bA h%ZA h%RA h%JA h%BA h1I^HHPTI#@H#@H @HH @ HtHÐUHSH=@ uKJ`H@ H-J`HHXH9s%HBH@ ŘJ`H@ H9r@ H[fff.UH== HtHtJ`IA@ÐH\$Ll$HLt$L|$AHl$Ld$H8L=)? H>IML-/? HIEHIEE1H$HHDmlV vLH> IUH5H810H\$Hl$Ld$Ll$ Lt$(L|$0H8fDH HcHfDHy> HH$fDH-a> HR> H5\HH}_H718 IH8> IUHMH5$H81wBDH= H5E1H(H<H5H%Af.111H1fDHIEr@Hi= D;0Ha= H8 I?EuWH<$f1҅dH5HiDH5HRAAw*H< H= $H1AWHH5AVAUATUSHHHHDHHHHb= BH=H ?= H=HIL= < I/HtxDE EH]8Hu-@SfDHH=< H51HH[PHt,} uH H=< H5HU1H[PHuHm(HuH < H=|bI/HSH]8HuDH=a< HH51HY; HH5_H81H[PHtJH{0tH=< HH5d1us(uK8SH=6 H519H=6 H5 1$H 6 H= JH 6 H= H={6 H5!1H=f6 H5#1H=Q6 H5J&1H=<6 H5U'1H='6 H5'1H=6 H5[(1lH=5 H5)1WH=5 H5)1BH 5 H=|*H=5 H5*1H=5 H5+1H 5 H=},OH=o5 H5,1H=Z5 H5-11H[]A\A]A^A_H=15 HUH51 8IH 4 H5 HHH3 H81K뒐AWIAVAUAATUSHx4 H$Lt$HD$H$hH$fDLL0H/ LJH5\$  LH@H]HDB u#fE@HHt$HhH$H5.AHA H2 H5N/IDHH2 H81Hx[]A\A]A^A_H5p.HAuH$ 8{uxuG3 tukH ?3 1HH3 H 1 HP8H@(H@8@ HP@HQHP0HQHH2 H(HAH 2 1`LH2 H$1.H 2 H2 }2 HA@HBPHBXHA@HHo2 HBPHA@HS-HB@A<#H+DH!<#uDH5,HIAA+=1 H1 HH$1uUoH$ 8{x1 H 1 1HxR8HHQ0 H5QHHH0 H81LH! t€DHAHDHL)HH/ H5+DHH/ H81 'fDH5+HujA=0 @H{/ H$1L $1AH3-LD;1H5+HtAV= 0 FH0 @H/ H$1jH/ H . / HB8HB(HB8HB@HAHB0HAHH/ HB(HAH]*HB+H5x*HA=K/ HK/ @(H$hH!/ 1L $H31APH$H$hH. 1L $H31APH$PcH$hH. PYH5)Hu/A=}. DH{. @@H5s)Hu^A=;. vH+- H$1L $1AH0H$hH. PH5 )H/u)A=- fH- H H5(HuaA=- fDH{, H$1L $1AH0H$hHV- PH5o(Hu)Ae=- fVH- H03H5;(HCu0A)=, fDH, @DwH5'Hu^A=, H+ H$1L $1AH0H$hHf, PH5'HAq=&, fD^H+ H$1L $1AH3H$hH+ 1L $H31AP #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 */ DB_ENV *%s_dbenv; /* Database environment handle */ DB *%s; /* Database handle */ DB *%s_%s; /* Database handle */ /* Public functions for use by the application */ int bdb_startup(void); int bdb_shutdown(void); 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_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[] = { %s { &%s_dbenv, "%s", %lu, %lu, %lu, %d, %d/* 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%s%s, &%s%s%s, "%s", %s, %lu, %lu, %lu, %s%s%s, %s%s%s%s, %s%s%s, %d, %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: %d: line too longenvironment.homecachesizeprivatedatabaseDB_BTREEcustomdupsortextentsizekey_typepagesizeprimaryrecnumre_lensecondary_offsettransactionbtreehashDB_HASHqueueDB_QUEUErecnoDB_RECNO%s: line %d: %s: invalid input ;4PxhHXzRx $pJMQ@4DBPB B(A0A8J4| BEB H(A0A8GX$PJf@ @ x$@@@o@@0@ d L`@@ o@ood@J` @ @ @ @ @. @> @N @^ @n @~ @ @ @ @ @ @ @ @ @ @ @.shstrtab.interp.note.ABI-tag.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.init.text.fini.rodata.eh_frame_hdr.eh_frame.ctors.dtors.jcr.dynamic.got.got.plt.data.bss @@ %@@@!o@(+ 0@03@d;od@d<Ho@pW@a@ k @ f @ `q0 @0 Hwx$@x$}$@$$XI@XI4I@IJ`JJ`JJ`JJ`JpL`pL8L`LhM`hMM`xMHxM